From 84dae193cbfb2359371ceea487533f13fdb790f5 Mon Sep 17 00:00:00 2001 From: jian Date: Thu, 1 Jun 2023 11:28:11 +0800 Subject: [PATCH 1/3] fix order demo --- examples/watch-order.html | 138 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 examples/watch-order.html diff --git a/examples/watch-order.html b/examples/watch-order.html new file mode 100644 index 000000000..3f437939d --- /dev/null +++ b/examples/watch-order.html @@ -0,0 +1,138 @@ + + + + + + + + + +
+ + + From 419d31cb446f6c1be8e102ab3c8901ce25eba232 Mon Sep 17 00:00:00 2001 From: jian Date: Thu, 1 Jun 2023 11:31:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/watch-order.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/watch-order.html b/examples/watch-order.html index 3f437939d..74c632a1e 100644 --- a/examples/watch-order.html +++ b/examples/watch-order.html @@ -43,7 +43,10 @@ bgap: 10, items: [{ type: 'bi.label', - text: '不应该在watch一个属性后再去修改属性,应该一次性改好,或者同步watch去做' + text: '父组件watch widget.**, 子组件watch了widget.arr, 修改widget中arr和dims的先后顺序不一样,会导致watch顺序不一样。' + }, { + type: 'bi.label', + text: '不应该在修改属性,watch到修改后,还修改配置,或者使用同步watch把配置修改全' }, { type: 'demo.child' }], From 23c8c021020ff3cb376674192dd7fffee55d2c54 Mon Sep 17 00:00:00 2001 From: jian Date: Thu, 1 Jun 2023 11:44:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/watch-order.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/watch-order.html b/examples/watch-order.html index 74c632a1e..7f85acdd6 100644 --- a/examples/watch-order.html +++ b/examples/watch-order.html @@ -16,7 +16,7 @@ widget: { name: "触发arr和dims变化", arr: [], - dims: {}, + dims: [], } }; }, @@ -84,11 +84,12 @@ addArrFirst: function () { // 修改arr在前,先触发arr的watch 再触发widget.**的监听 this.model.widget.arr.push(BI.UUID()); - Fix.set(this.model.widget.dims, BI.UUID(), {}); + this.model.widget.dims.push(BI.UUID()); + }, addDimFirst: function () { // 修改dim在前先执行 widget.** 再出发arr的watch - Fix.set(this.model.widget.dims, BI.UUID(), {}); + this.model.widget.dims.push(BI.UUID()); this.model.widget.arr.push(BI.UUID()); } }