v-html

v-html

  • Expects: String

  • Details:

    Updates the element’s innerHTML. The contents are inserted as plain HTML - data bindings are ignored. If you need to reuse template pieces, you should use partials.

    Internally, {{{ Mustache }}} interpolations are also compiled as a v-html directive using anchor nodes. The directive form requires a wrapper element, but offers slightly better performance and avoids FOUC (Flash of Uncompiled Content).

    Dynamically rendering arbitrary HTML on your website can be very dangerous because it can easily lead to XSS attacks. Only use v-html on trusted content and never on user-provided content.

  • Example:

    <div v-html="html"></div>
    <!-- same as -->
    <div>{{{html}}}</div>
doc_VueJS
2016-09-25 05:48:15
Comments
Leave a Comment

Please login to continue.