fix(compiler-core): dedupe renderSlot's default props (#4557)
This commit is contained in:
committed by
GitHub
parent
ed6470c845
commit
044812525f
@@ -346,6 +346,26 @@ describe('compiler: transform <slot> outlets', () => {
|
||||
callee: RENDER_SLOT,
|
||||
arguments: [`$slots`, `"default"`, `{}`, `undefined`, `true`]
|
||||
})
|
||||
const fallback = parseWithSlots(`<slot>fallback</slot>`, {
|
||||
slotted: false,
|
||||
scopeId: 'foo'
|
||||
})
|
||||
|
||||
const child = {
|
||||
type: NodeTypes.JS_FUNCTION_EXPRESSION,
|
||||
params: [],
|
||||
returns: [
|
||||
{
|
||||
type: NodeTypes.TEXT,
|
||||
content: `fallback`
|
||||
}
|
||||
]
|
||||
}
|
||||
expect((fallback.children[0] as ElementNode).codegenNode).toMatchObject({
|
||||
type: NodeTypes.JS_CALL_EXPRESSION,
|
||||
callee: RENDER_SLOT,
|
||||
arguments: [`$slots`, `"default"`, `{}`, child, `true`]
|
||||
})
|
||||
})
|
||||
|
||||
test(`error on unexpected custom directive on <slot>`, () => {
|
||||
|
||||
Reference in New Issue
Block a user