fe-interview
fe-interview copied to clipboard
[vue] vue2.0不再支持v-html中使用过滤器了怎么办?
[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这真的是件好事
没看懂这个问题,好像回答的也不是很仔细啊