We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// jsonuri.set(vm.data, "batters/batter/length", 1); var dta; jsonuri.set( [ { name: "a", // 0/children children: [ // 0/children/0 { name: "a-0" }, // 0/children/1 { name: "a-1", // 0/children/1/children children: [ // 0/children/1/children/0 { name: "a-1-0" }, // 0/children/1/children/1 { name: "a-1-1" }, { name: "a-1-2" }, { name: "a-1-3" }, ], }, // 0/children/2 { name: "a-2", // 0/children/2/children children: [ // 0/children/2/children/0 { name: "a-2-0" }, // 0/children/2/children/1 { name: "a-2-1", // 0/children/2/children/1/children children: [ { name: "a-2-1-0" }, // 0/children/2/children/1/children/1 { name: "a-2-1-1" }, { name: "a-2-1-2" }, { name: "a-2-1-3" }, ], }, { name: "a-2-2" }, { name: "a-2-3" }, ], }, ], }, ], "0/name", "aaaaa" ); var data = [ { name: "a", // 0/children children: [ // 0/children/0 { name: "a-0" }, // 0/children/1 { name: "a-1", // 0/children/1/children children: [ // 0/children/1/children/0 { name: "a-1-0" }, // 0/children/1/children/1 { name: "a-1-1" }, // 0/children/1/children/2 { name: "a-1-2" }, // 0/children/1/children/3 { name: "a-1-3" }, ], }, // 0/children/2 { name: "a-2", // 0/children/2/children children: [ // 0/children/2/children/0 { name: "a-2-0" }, // 0/children/2/children/1 { name: "a-2-1", // 0/children/2/children/1/children children: [ { name: "a-2-1-0" }, // 0/children/2/children/1/children/1 { name: "a-2-1-1" }, { name: "a-2-1-2" }, { name: "a-2-1-3" }, ], }, { name: "a-2-2" }, { name: "a-2-3" }, ], }, ], }, ]; // 把 a-2-1-1 移到 0/children/0 前面; // 期望:a-2-1-1 移到 0/children/0 前面,并且从 0/children/2/children/1/children/1 移除 // 实际:a-2-1-1 移到 0/children/0 前面,但未从 0/children/2/children/1/children/1 移除 jsonuri.mv(data, "0/children/2/children/1/children/1", "0/children/0", "before"); console.log(data);
The text was updated successfully, but these errors were encountered:
@haozi
Sorry, something went wrong.
看了源码,只对上一层做了处理,深层原数据就没有进行rm
看这个逻辑应该只是写了同层级移动的逻辑,不同层级往前移动,先进行移动后进行删除就有问题了
No branches or pull requests
The text was updated successfully, but these errors were encountered: