Skip to content

Commit 372fe54

Browse files
committed
modified: index.ts
1 parent ad4622f commit 372fe54

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

index.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export default function (
5151

5252
const leaves = computed(getLeaves);
5353

54-
const atlas = toReactive(computed(getAtlas));
54+
const arrLeaves = toReactive(leaves),
55+
objLeaves = toReactive(computed(getObjLeaves));
5556

5657
function getLeaves() {
5758
return getSiblingLeaves({ value });
@@ -83,7 +84,7 @@ export default function (
8384
return siblings.value.flatMap(defineProperties);
8485
}
8586

86-
function getAtlas() {
87+
function getObjLeaves() {
8788
return Object.fromEntries(leaves.value.map(getLeafEntry));
8889
}
8990

@@ -94,7 +95,7 @@ export default function (
9495
}
9596

9697
function add(pId: string) {
97-
const the = atlas[pId];
98+
const the = objLeaves[pId];
9899
if (the) {
99100
const children = the[keyChildren] as
100101
| Record<string, unknown>[]
@@ -119,7 +120,7 @@ export default function (
119120
}
120121

121122
function down(pId: string) {
122-
const the = atlas[pId];
123+
const the = objLeaves[pId];
123124
if (the) {
124125
const index = the[keyIndex] as number,
125126
nextIndex = index + 1,
@@ -133,7 +134,7 @@ export default function (
133134
}
134135

135136
function left(pId: string) {
136-
const the = atlas[pId];
137+
const the = objLeaves[pId];
137138
if (the) {
138139
const parent = the[keyParent] as Record<string, unknown> | undefined;
139140
if (parent?.[keyParent]) {
@@ -154,7 +155,7 @@ export default function (
154155
}
155156

156157
function remove(pId: string) {
157-
const the = atlas[pId];
158+
const the = objLeaves[pId];
158159
if (the) {
159160
const parent = the[keyParent] as Record<string, unknown> | undefined;
160161
if (parent) {
@@ -174,7 +175,7 @@ export default function (
174175
}
175176

176177
function right(pId: string) {
177-
const the = atlas[pId];
178+
const the = objLeaves[pId];
178179
if (the) {
179180
const prev = the[keyPrev] as Record<string, unknown> | undefined;
180181
if (prev) {
@@ -192,7 +193,7 @@ export default function (
192193
}
193194

194195
function up(pId: string) {
195-
const the = atlas[pId];
196+
const the = objLeaves[pId];
196197
if (the) {
197198
const index = the[keyIndex] as number,
198199
prevIndex = index - 1,
@@ -205,5 +206,5 @@ export default function (
205206
}
206207
}
207208

208-
return { add, atlas, down, leaves, left, remove, right, up };
209+
return { add, arrLeaves, down, leaves, left, objLeaves, remove, right, up };
209210
}

0 commit comments

Comments
 (0)