From b206d5988990bda3aa9e24724e1d516416caf0a0 Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Thu, 18 Mar 2021 17:02:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20feat:=20?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=8F=90=E4=BA=A4updateMode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/widget.js | 3 +-- ui/less/var.less | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/widget.js b/src/core/widget.js index f872b5470..b1d1fe258 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -76,8 +76,7 @@ shouldUpdate: null, - update: function () { - }, + update: null, beforeUpdate: null, diff --git a/ui/less/var.less b/ui/less/var.less index e55756a31..ec0631ef4 100644 --- a/ui/less/var.less +++ b/ui/less/var.less @@ -1,5 +1,5 @@ -@webUrl: 'resources?path=/com/fr/web/ui/'; +@webUrl: '/dist/'; @fontUrl: '@{webUrl}font/'; //图片的基本地址 @imageUrl: '@{webUrl}images/1x/'; //图片的基本地址 -@image2xUrl: '@{webUrl}images/2x/'; //2倍图片的基本地址 \ No newline at end of file +@image2xUrl: '@{webUrl}images/2x/'; //2倍图片的基本地址 From c95e2fb28d06b87520eb302f2cd8aa1f517fbeea Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Fri, 19 Mar 2021 09:02:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=20revert:=205fb75ef130a517e53b39421b384fa27914ccf0e0=20[5fb75e?= =?UTF-8?q?f]"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c8723708 --- src/core/wrapper/layout.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 5d4fdc470..20f68850c 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -71,12 +71,13 @@ BI.Layout = BI.inherit(BI.Widget, { var self = this; var frag = BI.Widget._renderEngine.createFragment(); var hasChild = false; - BI.each(this._children, function (i, widget) { - if (widget.element !== self.element) { - frag.appendChild(widget.element[0]); + for (var key in this._children) { + var child = this._children[key]; + if (child.element !== self.element) { + frag.appendChild(child.element[0]); hasChild = true; } - }); + } if (hasChild === true) { this.appendFragment(frag); } @@ -268,19 +269,13 @@ BI.Layout = BI.inherit(BI.Widget, { if (!child.shouldUpdate) { return null; } - return child.shouldUpdate(this._getOptions(item)) === true; + return child.shouldUpdate(this._getOptions(item)); }, updateItemAt: function (index, item) { if (index < 0 || index > this.options.items.length - 1) { return; } - - var child = this._children[this._getChildName(index)]; - var updated; - if (updated = child.update(this._getOptions(item))) { - return updated; - } var del = this._children[this._getChildName(index)]; delete this._children[this._getChildName(index)]; this.options.items.splice(index, 1); @@ -367,7 +362,14 @@ BI.Layout = BI.inherit(BI.Widget, { patchItem: function (oldVnode, vnode, index) { var shouldUpdate = this.shouldUpdateItem(index, vnode); - if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) { + var child = this._children[this._getChildName(index)]; + if (shouldUpdate) { + return child._update(this._getOptions(vnode), shouldUpdate); + } + if (shouldUpdate === null && !this._compare(oldVnode, vnode)) { + // if (child.update) { + // return child.update(this._getOptions(vnode)); + // } return this.updateItemAt(index, vnode); } }, From 6ce630e67c99cab93d7310f30050cb478ed39293 Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Fri, 19 Mar 2021 09:03:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20feat:=20?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=8F=90=E4=BA=A4updateMode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/less/var.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/less/var.less b/ui/less/var.less index ec0631ef4..c89fa87cc 100644 --- a/ui/less/var.less +++ b/ui/less/var.less @@ -1,4 +1,4 @@ -@webUrl: '/dist/'; +@webUrl: 'resources?path=/com/fr/web/ui/'; @fontUrl: '@{webUrl}font/'; //图片的基本地址 @imageUrl: '@{webUrl}images/1x/'; //图片的基本地址