vuejs/v2.vuejs.org

Error in template-compilation example code

defcc opened this issue · 0 comments

defcc commented

https://github.com/vuejs/vuejs.org/blob/05bb36f84a55237b6e2be503028d765f1f8c6392/src/v2/examples/vue-20-template-compilation/index.html#L56-L59

If there are two or more whitespace characters, the templateText value will be replaced incorrectly.

Maybe we need to remove the RegExp. Please let me know if I missed anything.

The error output is as bellow.

[Vue warn]: Error compiling template:

<div><header><h1>I'm a template!</h1></header><pv-if="message">{{ message }}</p><p v-else>No message.</p></div>

- v-else used on element <p> without corresponding v-if