Jelajahi Sumber

wip: only generate non-scope slot flag when compatConfig is present

Evan You 5 tahun lalu
induk
melakukan
61edb700d7
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      packages/compiler-core/src/transforms/vSlot.ts

+ 1 - 1
packages/compiler-core/src/transforms/vSlot.ts

@@ -302,7 +302,7 @@ export function buildSlots(
       children: TemplateChildNode[]
     ) => {
       const fn = buildSlotFn(props, children, loc)
-      if (__COMPAT__) {
+      if (__COMPAT__ && context.compatConfig) {
         fn.isNonScopedSlot = true
       }
       return createObjectProperty(`default`, fn)