Vue does not render using the template string style

problem description

A very common webpack single-page application project.
needs to use strings, save the template, not as a component, because there are too many templates.
for example, I have a template string template data, which I call in v-html, and this string template will not be recognized and rendered by css.

the environmental background of the problems and what methods you have tried

at first, I thought it was the problem of less, but it would be the same to rewrite it as css. Although I know that some inline styles should be OK, the change is too big.

what result do you expect? What is the error message actually seen?

I hope that the template string can be rendered by css. I found that the elements written directly on the template will automatically add custom attributes such as data-, but the template string will not, probably due to the packaging mechanism.

Nov.26,2021

remove scoped

Menu