在v-html指令时如何使用过滤器
// html
<div class="word" v-html="$options.filters.filters2(item.news_content)"></div>
// script
filters: {
filters2: function (arg) {
arg.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {
arg = arg.replace(new RegExp(capture, 'g'), baseImgUrl + capture);
});
return arg;
}
}