Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

Vue - template syntax

0 votes
14 views
added Nov 5 in Vue by LC Marshal Captain (25,420 points)
<!--Double mustaches interprets data as plain text, not a full HTML. -->
<p>Using mustaches: {{ rawHtml }}</p>

<!--To output HTML, please use v-html directive:-->
<p>Using v-html directive: <span v-html="rawHtml"></span></p>

 

2 Responses

0 votes
responded Nov 5 by LC Marshal Captain (25,420 points)
<!--HTML Attributes-->

Mustaches cant be used in attributes. Instead, use a v-bind directive:
<div v-bind:id="dynamicElement"></div>

 

0 votes
responded Nov 5 by LC Marshal Captain (25,420 points)
<!--For boolean attributes, use v-bind directive, but it'll work slight different-->
<button v-bind:disabled="isDisabled">Click me</button>

<!--If isDisabled has null, undefined, or false value, the disabled attribute will not be assigned to <button> element.-->

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...