wip(ssr): basic element hydration

This commit is contained in:
Evan You
2020-02-13 17:47:00 -05:00
parent 35d91f4e18
commit 6b505dcd23
11 changed files with 202 additions and 43 deletions

View File

@@ -4,6 +4,8 @@ import {
PUSH_SCOPE_ID,
POP_SCOPE_ID
} from '../src/runtimeHelpers'
import { PatchFlags } from '@vue/shared'
import { genFlagText } from './testUtils'
describe('scopeId compiler support', () => {
test('should only work in module mode', () => {
@@ -81,8 +83,12 @@ describe('scopeId compiler support', () => {
expect(code).toMatch(
[
`_pushScopeId("test")`,
`const _hoisted_1 = _createVNode("div", null, "hello", -1)`,
`const _hoisted_2 = _createVNode("div", null, "world", -1)`,
`const _hoisted_1 = _createVNode("div", null, "hello", ${genFlagText(
PatchFlags.HOISTED
)})`,
`const _hoisted_2 = _createVNode("div", null, "world", ${genFlagText(
PatchFlags.HOISTED
)})`,
`_popScopeId()`
].join('\n')
)