]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-sfc): fix script setup ts helpers
authorEvan You <yyx990803@gmail.com>
Fri, 30 Oct 2020 20:56:12 +0000 (16:56 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 30 Oct 2020 20:56:12 +0000 (16:56 -0400)
packages/compiler-sfc/src/compileScript.ts

index 9b93717cc1e2d634494d0ca3b99ea1fc7c8ccea8..7ba32b8572d6e4404f013809648afbd2be87f79e 100644 (file)
@@ -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<string, any>`
 
   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) {