(instance, children)
| 1 | import { ShapeFlags } from "../shared/ShapeFlags"; |
| 2 | |
| 3 | export const initSlots = (instance, children) => { |
| 4 | // 数组类型结构渲染 |
| 5 | // instance.slots = Array.isArray(children) ? children : [children]; |
| 6 | |
| 7 | const { vnode } = instance; |
| 8 | if (vnode.shapeFlag & ShapeFlags.SLOT_CHILDREN) { |
| 9 | normalizeObjectSlots(children, instance.slots); |
| 10 | } |
| 11 | }; |
| 12 | |
| 13 | const normalizeObjectSlots = (children, slots) => { |
| 14 | for (const key in children) { |
no test coverage detected