Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 714afd7

Browse files
authored
fix: default render function name for ssr (#402)
1 parent 6960203 commit 714afd7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/index.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ function getTemplateCode(
466466
hasScoped: boolean,
467467
isServer: boolean
468468
) {
469-
let templateImport = `const render = () => {}`
469+
const renderFnName = isServer ? 'ssrRender' : 'render'
470+
let templateImport = `const ${renderFnName} = () => {}`
470471
let templateRequest
471472
if (descriptor.template) {
472473
const src = descriptor.template.src || resourcePath
@@ -476,9 +477,7 @@ function getTemplateCode(
476477
const attrsQuery = attrsToQuery(descriptor.template.attrs)
477478
const query = `?vue&type=template${idQuery}${srcQuery}${scopedQuery}${attrsQuery}`
478479
templateRequest = _(src + query)
479-
templateImport = `import { ${
480-
isServer ? 'ssrRender' : 'render'
481-
} } from ${templateRequest}`
480+
templateImport = `import { ${renderFnName} } from ${templateRequest}`
482481
}
483482

484483
return templateImport

0 commit comments

Comments
 (0)