[vue] vue2.0不再支持v-html中使用过滤器了怎么办?
在method中定义方法
htmlFilter(htmlString){
return htmlString.replace(/+s/g,'')
}
在vue中 v-html="htmlFilter(htmlString)"
即可
1:全局方法
2:computed
3:$options.filters
使用过滤器 Vue.filter
其实这些问题是工作的时候也会遇到的很重要的问题,熟练掌握记住api这真的是件好事
Most helpful comment
1:全局方法
2:computed
3:$options.filters