Don't pass context attrs to HTML elements
This commit is contained in:
1 parent
49b5e582cc
commit
795a0f8273
1 file changed
+4
-2
+4
-2
@@ -110,8 +110,10 @@ function applyContext(vnode, parentContext): void {
|
|||||||
for (const c of vnode) applyContext(c, parentContext);
|
for (const c of vnode) applyContext(c, parentContext);
|
||||||
} else if (vnode && typeof vnode === "object" && vnode.tag) {
|
} else if (vnode && typeof vnode === "object" && vnode.tag) {
|
||||||
const vc = Object.assign({}, parentContext, vnodeContext.get(vnode));
|
const vc = Object.assign({}, parentContext, vnodeContext.get(vnode));
|
||||||
vnodeContext.set(vnode, vc);
|
if (typeof vnode.tag !== "string") {
|
||||||
vnode.attrs = Object.assign({}, vc, vnode.attrs);
|
vnodeContext.set(vnode, vc);
|
||||||
|
vnode.attrs = Object.assign({}, vc, vnode.attrs);
|
||||||
|
}
|
||||||
if (vnode.children && vnode.children.length)
|
if (vnode.children && vnode.children.length)
|
||||||
for (const c of vnode.children) applyContext(c, vc);
|
for (const c of vnode.children) applyContext(c, vc);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user