From: Evan You Date: Fri, 30 Oct 2020 20:56:12 +0000 (-0400) Subject: fix(compiler-sfc): fix script setup ts helpers X-Git-Tag: v3.0.3~50^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e3abc86058f967bcf6fad94c62572989d4dbcbc;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): fix script setup ts helpers --- diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 9b93717cc1..7ba32b8572 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -358,7 +358,7 @@ export function compileScript( let propsType = `{}` let emitType = `(e: string, ...args: any[]) => void` - let slotsType = `__Slots__` + let slotsType = `Slots` let attrsType = `Record` let propsASTNode @@ -662,7 +662,7 @@ export function compileScript( // 7. finalize setup argument signature. let args = `` if (isTS) { - if (slotsType === '__Slots__') { + if (slotsType === 'Slots') { helperImports.add('Slots') } const ctxType = `{ @@ -726,7 +726,7 @@ export function compileScript( const runtimeProps = genRuntimeProps(typeDeclaredProps) const runtimeEmits = genRuntimeEmits(typeDeclaredEmits) s.append( - `export default __defineComponent__({${def}${runtimeProps}${runtimeEmits}\n setup\n})` + `export default defineComponent({${def}${runtimeProps}${runtimeEmits}\n setup\n})` ) } else { if (defaultExport) {