vue分类筛选filter方法简单实例

前端之家收集整理的这篇文章主要介绍了vue分类筛选filter方法简单实例前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

本文实例为大家分享了vue分类筛选filter方法的具体代码,供大家参考,具体内容如下

<Meta charset="utf-8"> filter
  • <script src="../js/vue.min.js">
    <script type="text/javascript">
    var vm = new Vue({
    el: '#app',data: {
    size:5,list:[
    {"id":0,"title":"11111","cont":"111111"},{"id":1,"title":"22222",{"id":2,"title":"33333",{"id":3,"title":"44444",{"id":4,"title":"55555","cont":"55555"},{"id":5,"title":"66666","cont":"66666"},{"id":6,"title":"77777","cont":"77777"},{"id":7,"cont":"88888"},{"id":8,"title":"888888","cont":"999999"},{"id":9,"title":"000000","cont":"99999"},{"id":10,"title":"a88888",{"id":11,"title":"a22222",{"id":12,"title":"a33333",{"id":13,"title":"a44444",{"id":14,"title":"a55555",{"id":15,"title":"a66666",{"id":16,"title":"a77777",{"id":17,{"id":18,"title":"a888888",{"id":19,"title":"a000000",{"id":20,"cont":"99999"}
    ]
    },computed: {
    filterlist: function () {
    var num=this.size;
    return this.list.filter(function (number) {
    return number.id < num
    })
    }
    },methods:{
    agg:function(){
    this.size+=5;
    }
    }
    });

  • 本文已被整理到了《》,欢迎大家学习阅读。

    关于vue.js组件的教程,请大家点击专题进行学习。

    以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家。

    猜你在找的Vue相关文章