Skip to content

Commit 505278b

Browse files
committed
commit
1 parent 5ae7bcb commit 505278b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cample",
3-
"version": "3.2.0-alpha.39",
3+
"version": "3.2.0-alpha.40",
44
"description": "Cample.js - fast modern javascript framework. Reactivity without virtual DOM!",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/core/components/component/component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ export class Component extends DataComponent {
290290
functions: FunctionsType
291291
) => {
292292
const renderNewData = (value: string) => {
293+
// const values = getValues(index);
293294
const val = renderComponentDynamicKeyData(
294295
getData(this._dynamic.data.data.values, index),
295296
value

src/core/components/each/each.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ export class Each extends DataComponent {
176176
importData: any,
177177
oldData: any
178178
) => {
179-
const { values, nodes, stack, renderImport } = currentNode;
179+
const { values, nodes, stack, ri } = currentNode;
180180
if (oldData[eachIndex] !== indexData) {
181181
for (let i = 0; i < values.length; i++) {
182182
const value = values[i];
183183
value(nodes, stack, indexData, importData, eachIndex, value);
184184
}
185185
}
186-
(renderImport as any)(nodes, stack, indexData, importData, eachIndex);
186+
(ri as any)(nodes, stack, indexData, importData, eachIndex);
187187
};
188188
const renderNewData = (
189189
oldData: any,
@@ -233,7 +233,6 @@ export class Each extends DataComponent {
233233
nodeNext = document.createComment("");
234234
parentNode.appendChild(nodeNext);
235235
}
236-
currentComponent.nodes = new Array(newDataLength);
237236
if (this.isIteration) {
238237
for (let i = 0; i < newDataLength; i++) {
239238
const indexData = data[i];
@@ -249,7 +248,7 @@ export class Each extends DataComponent {
249248
importData,
250249
newKey
251250
);
252-
currentComponent.nodes[i] = currentNode;
251+
currentComponent.nodes.push(currentNode);
253252
parentNode.insertBefore(el, nodeNext);
254253
}
255254
} else {
@@ -266,7 +265,7 @@ export class Each extends DataComponent {
266265
importData,
267266
newKey
268267
);
269-
currentComponent.nodes[i] = currentNode;
268+
currentComponent.nodes.push(currentNode);
270269
parentNode.insertBefore(el, nodeNext);
271270
}
272271
}

src/core/functions/data/create-element.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const createElement = (
7575
}
7676
const currentNode: NodeType = {
7777
values: newValues,
78-
renderImport,
78+
ri: renderImport,
7979
dataId,
8080
nodes: newNodes,
8181
stack,

src/types/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ export type NodeNodesType = Array<ChildNode | null>;
445445
export type NodeType = {
446446
isNew?: boolean;
447447
key?: string;
448-
renderImport?: (...args: any[]) => void;
448+
ri?: (...args: any[]) => void;
449449
el?: Node;
450450
nodes: NodeNodesType;
451451
stack: StackType;

0 commit comments

Comments
 (0)