wip: exclude legacy slots from $scopedSlots

This commit is contained in:
Evan You
2021-05-05 11:06:04 -04:00
parent b14de6c3f8
commit 7f93c76b96
7 changed files with 80 additions and 28 deletions

View File

@@ -61,7 +61,8 @@ export const withScopeId = (_id: string) => withCtx
*/
export function withCtx(
fn: Function,
ctx: ComponentInternalInstance | null = currentRenderingInstance
ctx: ComponentInternalInstance | null = currentRenderingInstance,
isNonScopedSlot?: boolean // __COMPAT__ only
) {
if (!ctx) return fn
const renderFnWithContext = (...args: any[]) => {
@@ -83,5 +84,8 @@ export function withCtx(
// this is used in vnode.ts -> normalizeChildren() to set the slot
// rendering flag.
renderFnWithContext._c = true
if (__COMPAT__ && isNonScopedSlot) {
renderFnWithContext._nonScoped = true
}
return renderFnWithContext
}