j-templates 7.0.9 → 7.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Node/vNode.js +27 -23
- package/package.json +1 -1
package/Node/vNode.js
CHANGED
|
@@ -141,30 +141,34 @@ function InitNode(vnode) {
|
|
|
141
141
|
}
|
|
142
142
|
function StaticChildren(vnode, children) {
|
|
143
143
|
const childrenScope = Store_1.ObservableScope.Create(WrapStaticChildren(vnode.injector, children));
|
|
144
|
+
vnode.scopes.push(childrenScope);
|
|
144
145
|
const child = Store_1.ObservableScope.Peek(childrenScope);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
146
|
+
const type = typeof child;
|
|
147
|
+
switch (type) {
|
|
148
|
+
case 'string': {
|
|
149
|
+
const node = vNode.Create({
|
|
150
|
+
type: "text",
|
|
151
|
+
namespace: null,
|
|
152
|
+
props() {
|
|
153
|
+
return { nodeValue: Store_1.ObservableScope.Value(childrenScope) };
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
vnode.children = [node];
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
default: {
|
|
160
|
+
Store_1.ObservableScope.Touch(childrenScope);
|
|
161
|
+
Store_1.ObservableScope.Watch(childrenScope, CreateScheduledCallback(function () {
|
|
162
|
+
if (vnode.destroyed)
|
|
163
|
+
return;
|
|
164
|
+
vNode.DestroyAll(vnode.children);
|
|
165
|
+
const nodes = Store_1.ObservableScope.Peek(childrenScope);
|
|
166
|
+
vnode.children = Array.isArray(nodes) ? nodes : [nodes];
|
|
167
|
+
UpdateChildren(vnode);
|
|
168
|
+
}));
|
|
169
|
+
vnode.children = (Array.isArray(child) ? child : [child]);
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
function WrapStaticChildren(injector, children) {
|