test(compiler-ssr): fix typo (#713)

This commit is contained in:
djy0 2020-02-10 22:20:07 +08:00 committed by GitHub
parent e308ad99e9
commit 42db2fef9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View File

@ -30,18 +30,13 @@ describe('ssr: components', () => {
}" }"
`) `)
expect(compile(`<compoonent :is="foo" prop="b" />`).code) expect(compile(`<component :is="foo" prop="b" />`).code)
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
"const { resolveComponent: _resolveComponent } = require(\\"vue\\") "const { resolveDynamicComponent: _resolveDynamicComponent } = require(\\"vue\\")
const { ssrRenderComponent: _ssrRenderComponent } = require(\\"@vue/server-renderer\\") const { ssrRenderComponent: _ssrRenderComponent } = require(\\"@vue/server-renderer\\")
return function ssrRender(_ctx, _push, _parent) { return function ssrRender(_ctx, _push, _parent) {
const _component_compoonent = _resolveComponent(\\"compoonent\\") _push(_ssrRenderComponent(_resolveDynamicComponent(_ctx.foo, _ctx.$), { prop: \\"b\\" }, null, _parent))
_push(_ssrRenderComponent(_component_compoonent, {
is: _ctx.foo,
prop: \\"b\\"
}, null, _parent))
}" }"
`) `)
}) })

View File

@ -36,7 +36,7 @@ export function compile(
scopeId: options.mode === 'function' ? null : options.scopeId, scopeId: options.mode === 'function' ? null : options.scopeId,
// always prefix since compiler-ssr doesn't have size concern // always prefix since compiler-ssr doesn't have size concern
prefixIdentifiers: true, prefixIdentifiers: true,
// disalbe optimizations that are unnecessary for ssr // disable optimizations that are unnecessary for ssr
cacheHandlers: false, cacheHandlers: false,
hoistStatic: false hoistStatic: false
} }