Vue - template syntax

0 votes
370 views
added Nov 5, 2019 in Vue by LC Marshal Captain (25,790 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, 2019 by LC Marshal Captain (25,790 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, 2019 by LC Marshal Captain (25,790 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.
...