-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
Description
Version
2.4.2
Reproduction link
https://github.com/nickmessing/vue-ssr-issue
Steps to reproduce
Use domPropsInnerHTML
in JSX or v-html
in Vue Template.
Or:
- Clone the repo
npm install
npm run dev
- Open http://localhost:3000 and http://localhost:3000/jsx
What is expected?
No warning in console.
What is actually happening?
DOM Mismatching error.
v-html
works fine when there are no children, but fails if there are.
One option is to completely ignore innerHTML
and v-html
in vue-ssr. Basically commenting this line solves the problem.
Another option is evaluating innerHTML
before comparing DOM snapshots so you get value from innerHTML
on static SSR-rendered website without DOM Mismatch.
Third option is ignoring children in createElment
if there is innerHTML
domProp. I think this one is the best.