Binding HTML to property (Vue.js) -
how can bind html vue component property?
in php script have:
$html = '<div>some text</div>'; $box = "<box_includes html_text='$html' ></box_includes>";
in vue template:
<template id="template_box_includes"> {{ html_text }} </template>
but in browser see text, including tags, it's being recognized text:
<div>some text</div>
in vue js, use of double braces escaping html. need use 3 avoid escaping html so:
<template id="template_box_includes"> {{{ html_text }}} </template>
you can learn more on page of documentation: http://vuejs.org/guide/syntax.html#raw-html
i hope helps!
Comments
Post a Comment