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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -