How to parse HTML code in mustache binding? Currently newline characters (
) will only be displayed/escaped.
Small Vue application:
var logapp = new Vue({ el: '#logapp', data: { title: 'Logs', logs: [ { status: true, type: 'Import', desc: 'Learn
JavaScript', date: '11.11.2015', id: 1 }, { status: true, type: 'Import', desc: 'Learn
JavaScript', date: '11.11.2015', id: 1 } ] } })
The following is the template:
{{fail}} {{type}} {{description}} {{stamp}} {{id}}
Starting from Vue2, the three curly braces are deprecated, you need to use
v-html
.It's not clear from thedocumentation linkwhat we should put in
v-html
, your variables should be placed inv-html
.Also,or
Like+0
Add Reply
P粉253518620
v-html
only works with, not
.
If you want to see it live in the app, please clickhere.
You can use the
v-html
directive to display it. like this: