Vue中在methods方法中使用filter里的方法
vue中在methods中使用filter里的方法
this.$options.filters['filterName'] (val)
filters: {
typeFilter: function (type) {
switch (type){
case '1':
return '平面'
break;
case '2':
return '视频'
break;
case '3':
return '景观小品'
break;
}
}
},
methods:{
getType(val){
this.$options.filters['typeFilter'] (val)
}
}