mirror of
https://github.com/MercuryWorkshop/dreamlandjs.git
synced 2025-05-16 23:50:00 -04:00
rework <slot/>
This commit is contained in:
parent
b424342d64
commit
3cd8372c08
3 changed files with 4 additions and 5 deletions
6
js.js
6
js.js
|
@ -165,12 +165,12 @@ export function h(type, props, ...children) {
|
|||
}
|
||||
Object.assign(newthis, props);
|
||||
|
||||
let slot = [];
|
||||
newthis.children = [];
|
||||
for (const child of children) {
|
||||
JSXAddChild(child, slot.push.bind(slot));
|
||||
JSXAddChild(child, newthis.children.push.bind(slot));
|
||||
}
|
||||
|
||||
let elm = type.apply(newthis, [slot]);
|
||||
let elm = type.apply(newthis);
|
||||
elm.$ = newthis;
|
||||
newthis.root = elm;
|
||||
if (newthis.css) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue