浏览代码

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

Evan You 5 年之前
父节点
当前提交
61edb700d7
共有 1 个文件被更改,包括 1 次插入1 次删除
  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[]
       children: TemplateChildNode[]
     ) => {
     ) => {
       const fn = buildSlotFn(props, children, loc)
       const fn = buildSlotFn(props, children, loc)
-      if (__COMPAT__) {
+      if (__COMPAT__ && context.compatConfig) {
         fn.isNonScopedSlot = true
         fn.isNonScopedSlot = true
       }
       }
       return createObjectProperty(`default`, fn)
       return createObjectProperty(`default`, fn)