Level 53
Have a look at this for filters replacement in Vuejs 2.0.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a filter that converts line breaks to html, in previous versions normally i use the filter like this:
{{ description | nl2br }}
That actually works but the html its escaped, so doesn't show as HTML, the triple mustach doesn't work {{{ description | nl2br }}} (seems that its deprecated)
so i found in the documentation the v-html="" that works with html string but when i apply the filter it doesn't work, i didnt found the syntax o how can achieve that:
<p v-html="description|nl2br"></p>
// this doesn't work returns: Property or method "nl2br" is not defined on the instance but referenced during render
Any idea?
Just find a solution:
<p v-html="this.$options.filters.nl2br(description)"></p>
Please or to participate in this conversation.