Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue removes html tags in script tags wrapped by v-pre #5526

Closed
marcelgwerder opened this issue Apr 26, 2017 · 1 comment
Closed

Vue removes html tags in script tags wrapped by v-pre #5526

marcelgwerder opened this issue Apr 26, 2017 · 1 comment

Comments

@marcelgwerder
Copy link

Version

2.2.6

Reproduction link

https://jsbin.com/holacowepe/1/edit?html,js,console

Steps to reproduce

  • Add script template including html tags
  • Wrap script tag with Vue

What is expected?

Script content isn't touched at all.

What is actually happening?

All html tags are removed.


I am migrating a website to Vue and do have some plain js code that reads out templates in a script tag on click. When the html is within a Vue template it removes all html tags in the script tag. I can't rewrite the whole site so I wanted to leave this part as it is. The same happens if I use v-pre which to my understanding should prevent Vue from doing anything to this part of the DOM.

I guess there are good reasons for the behavior but I haven't quite figured them out yet...

@pbastowski
Copy link

pbastowski commented Apr 26, 2017

@marcelgwerder
Here are a couple of examples of how to use inline HTML templates with Vue.
https://jsbin.com/qebuzav/1/edit?html,js,output

Does this help you? I'm not sure why you were trying to wrap script tags in v-pre, so, perhaps I'm not getting your requirement right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants