1. 列表过滤
运用了Vue实例化的 computed (计算属性)
例子:
<div id="test">
<input type="text" v-model='searchName'>
<ul>
<li v-for= "(p,index) in filterP":key="index">
{
{index}}--{
{p.name}}--{
{p.age}}
</li>
</ul>
<button>年龄升序</button>
<button>年龄降序</button>
<button>原本顺序</button>
</div>
<script src="./vue.js"></script>
<script>
new Vue({
el : '#test',
data :{
searchName:"",
persons:[
{name : 'tom',age:18},
{name : 'tzh',age:19},