Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into p1
Browse files Browse the repository at this point in the history
  • Loading branch information
wxsms committed Dec 9, 2021
2 parents dc83624 + 7337732 commit f022fef
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 85 deletions.
26 changes: 17 additions & 9 deletions example/patchChildren/PatchChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,29 @@ const isChange = ref(false);
// h("div", { key: "c", id: "new-c" }, "c"),
// ];


// 第八种情况
// 移动元素位置( anchor 没有值的情况下 )
// 要移动的元素是属于最后一个位置
const prevChildren = [
h("div", { key: "a", id: "old-a" }, "a"),
h("div", { key: "b", id: "old-b" }, "b"),
];
// const prevChildren = [
// h("div", { key: "a", id: "old-a" }, "a"),
// h("div", { key: "b", id: "old-b" }, "b"),
// ];
// const nextChildren = [
// h("div", { key: "b", id: "old-b" }, "b"),
// h("div", { key: "a", id: "old-a" }, "a"),
// ];

// 在左侧添加新元素
// (a b)
// c (a b)
// i = 0, e1 = -1, e2 = 0
const prevChildren = [h("p", { key: "A" }, "A"), h("p", { key: "B" }, "B")];
const nextChildren = [
h("div", { key: "b", id: "old-b" }, "b"),
h("div", { key: "a", id: "old-a" }, "a"),
h("p", { key: "C" }, "C"),
h("p", { key: "A" }, "A"),
h("p", { key: "B" }, "B"),
];



export default {
name: "PatchChildren",
setup() {},
Expand Down
50 changes: 25 additions & 25 deletions lib/mini-vue.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/mini-vue.cjs.js.map

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions lib/mini-vue.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/mini-vue.esm.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit f022fef

Please sign in to comment.