vue filter 过滤器
//filter.js 文件 let filter_price = function (val,...params){ return "¥" + val } let filter_date = function (){ return "2019/10/20" + val } export {filter_price,filter_date} //导出过滤函数
//main.js
import * as filter from './filters/filter'
console.log(filter)
Object.keys(_filter).forEach(item=>{
Vue.filter(item,_filter[item])
})
new Vue({
router,store,
render: h => h(App),
}).$mount('#app')