Issue
How can I manage to get HTML interpreted inside a mustache binding? At the moment the break (<br />
) is just displayed/escaped.
Small Vue app:
var logapp = new Vue({
el: '#logapp',
data: {
title: 'Logs',
logs: [
{ status: true, type: 'Import', desc: 'Learn<br />JavaScript', date: '11.11.2015', id: 1 },
{ status: true, type: 'Import', desc: 'Learn<br />JavaScript', date: '11.11.2015', id: 1 }
]
}
})
And here is the template:
<div id="logapp">
<table>
<tbody>
<tr v-repeat="logs">
<td>{{fail}}</td>
<td>{{type}}</td>
<td>{{description}}</td>
<td>{{stamp}}</td>
<td>{{id}}</td>
</tr>
</tbody>
</table>
</div>
Solution
You can use the v-html
directive to show it.
like this:
<td v-html="desc"></td>
Answered By - 王开朗
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.