How to display raw html with filter?
I have something like this:
K.json = function( json ) {
if( typeof json!=
For completeness, you have some options, like:
v-html="$options.filters.FILTERNAME(args)"
or:inner-html.prop="args | FILTERNAME"
orv-html="METHODNAME(args)"
, if you create a method.See demo below.
function json(text) {
// do your magic
return text.toUpperCase(); // just for demo
}
Vue.filter('json', function (value) {
return json(value);
})
new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!'
},
methods: {
jsonMethod(v) {
return json(v); // create a "proxy" to the outer function
}
}
})