Vue: Cannot escape quotes in String

Created on 25 Mar 2019  Â·  2Comments  Â·  Source: vuejs/vue

Version

2.6.10

Reproduction link

https://codepen.io/anon/pen/zbbaEp?editors=1010

Steps to reproduce

Click on the link.

What is expected?

Quote escaping works the same both in template and javascript.

What is actually happening?

Quote escaping doesn't work in templates.

Most helpful comment

HTML escaping is different from JS, you must use <div v-text="'<div style=&quot;background-color:red;&quot;>Red block</div>'">. You were also missing the single quotes for the directive v-text to work

Note this isn't related to Vue though

All 2 comments

HTML escaping is different from JS, you must use <div v-text="'<div style=&quot;background-color:red;&quot;>Red block</div>'">. You were also missing the single quotes for the directive v-text to work

Note this isn't related to Vue though

Ok, thank you ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gkiely picture gkiely  Â·  3Comments

lmnsg picture lmnsg  Â·  3Comments

hiendv picture hiendv  Â·  3Comments

julianxhokaxhiu picture julianxhokaxhiu  Â·  3Comments

aviggngyv picture aviggngyv  Â·  3Comments