Subscribe on changes!

v-html affect the whole page, not just directive

avatar
Mar 12th 2022

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Just open link and you see right away

What is expected?

v-html content with css inside only affect inside element with v-html directive

What is actually happening?

It affect the whole page, not just the component, the whole app


I think I know why, v-html css don't scope. But to the very least, we should have a way around this

avatar
Mar 12th 2022

That's expected. v-html inserts plain html. You are therefore Limited to the capabilities of plain html.

We don't plan on putting any sort of effort in extending v-html capabilities. It's an escape hedge for edge cases, not a central feature.