I have data like so:
new Vue({
el: '#app',
data: {
icons: [
{ "name": "Car", "css": "car" }, { "name": "Airplane", "css": "airplane" }
]
}
});
And I want to bind the css
value to my view inside an HTML <code>
element and formatted and rendered as so:
<i class="fa fa-car></i>
Here's my attempt using Vuejs2.0:
<code>%lt;i class="fa" :class="'fa-' + icon.css"></i></code>
Unfortunately, the DOM is rendered like so:
<i class="fa" :class="'fa-' + icon.css"></i>
How do I make this work? Thanks!