过滤器
来源:互联网 发布:python 高斯拟合 编辑:程序博客网 时间:2024/05/17 07:35
--------------------------------------debounce 延迟2000-----------------------------
<input type="text" @keyup="show | debounce 2000">
---------------------------------limitBy 取几条数据------------------------------
<div id="box"> <ul> <li v-for="val in arr | limitBy 2">{{val}}</li> //limitBy 2 1 第一个2是取几条数据 第二个1是从下标几开始取 </ul></div>data:{ arr:[1,2,3,4,5]},
--------------------------------filterBy 过滤数据--------------------------
<li v-for="val in arr | filterBy 'w'">{{val}}</li> //意思是数组中有w的都会输出--------------------------------orderBy 排序--------------------------
<li v-for="val in arr | orderBy 1">{{val}}</li> //1是正序 -1是倒叙---------------------------------自定义过滤器-----------------------{{a | toDou}}Vue.filter('toDou', function () { return input<10?'0'+input:''+input;});---------------------------------自定义事件过滤器-----------------------------{{a | date}}data:{ a:Date.now()},return oDate.getFullYear()+'-'+(oDate.getMonth()+1)+'-'+oDate.getDate()+'-'+oDate.getHours()+':'+oDate.getMinutes()+':'+oDate.getSeconds()
0 0