-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
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 installnpm 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.