const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createBlock: _createBlock, renderSlot: _renderSlot } = _Vue
return (_openBlock(true), _createBlock(_Fragment, null, _renderList(items, (item) => {
- return _renderSlot($slots, \\"default\\")
+ return _renderSlot($slots, \\"default\\", {}, undefined, true)
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createBlock: _createBlock, renderSlot: _renderSlot } = _Vue
return (_openBlock(true), _createBlock(_Fragment, null, _renderList(items, (item) => {
- return _renderSlot($slots, \\"default\\")
+ return _renderSlot($slots, \\"default\\", {}, undefined, true)
}), 256 /* UNKEYED_FRAGMENT */))
}
}"
const { renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue
return ok
- ? _renderSlot($slots, \\"default\\", { key: 0 })
+ ? _renderSlot($slots, \\"default\\", { key: 0 }, undefined, true)
: _createCommentVNode(\\"v-if\\", true)
}
}"
const { renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue
return ok
- ? _renderSlot($slots, \\"default\\", { key: 0 })
+ ? _renderSlot($slots, \\"default\\", { key: 0 }, undefined, true)
: _createCommentVNode(\\"v-if\\", true)
}
}"
return (_openBlock(), _createBlock(\\"div\\", null, [
_cache[1] || (
_setBlockTracking(-1),
- _cache[1] = _renderSlot($slots, \\"default\\"),
+ _cache[1] = _renderSlot($slots, \\"default\\", {}, undefined, true),
_setBlockTracking(1),
_cache[1]
)
function parseWithSlots(template: string, options: CompilerOptions = {}) {
const ast = parse(template)
transform(ast, {
+ slotted: false,
nodeTransforms: [
...(options.prefixIdentifiers ? [transformExpression] : []),
transformSlotOutlet,
expect(codegenNode.consequent).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
- arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })]
+ arguments: [
+ '$slots',
+ '"default"',
+ createObjectMatcher({ key: `[0]` }),
+ 'undefined',
+ 'true'
+ ]
})
expect(generate(root).code).toMatchSnapshot()
})
expect(codegenNode.consequent).toMatchObject({
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_SLOT,
- arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })]
+ arguments: [
+ '$slots',
+ '"default"',
+ createObjectMatcher({ key: `[0]` }),
+ 'undefined',
+ 'true'
+ ]
})
expect(generate(root).code).toMatchSnapshot()
})
openBlock,
createBlock,
Fragment,
- createCommentVNode
+ createCommentVNode,
+ Slot
} from '../../src'
import { PatchFlags } from '@vue/shared'
},
// mock instance
{ type: {} } as any
- )
+ ) as Slot
// manual invocation should not track
const manual = (openBlock(), createBlock(Fragment, null, slot()))