From 4e4066beddbf3deb15e5cb45d9969091c9b063fd Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 25 Oct 2017 11:54:38 +0800 Subject: [PATCH] =?UTF-8?q?shouldUpdate=E7=94=9F=E5=91=BD=E5=91=A8?= =?UTF-8?q?=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/core/abstract/demo.virtual_group.js | 5 +++++ dist/demo.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/demo/js/core/abstract/demo.virtual_group.js b/demo/js/core/abstract/demo.virtual_group.js index afda6ec1e3..0397e5cda0 100644 --- a/demo/js/core/abstract/demo.virtual_group.js +++ b/demo/js/core/abstract/demo.virtual_group.js @@ -89,6 +89,11 @@ Demo.Item = BI.inherit(BI.Widget, { } }, + shouldUpdate: function (nextProps) { + var o = this.options; + return o.type !== nextProps.type || o.key !== nextProps.key || o.value !== nextProps.value; + }, + update: function (item) { this.label.setText(item.value); console.log("更新了一项"); diff --git a/dist/demo.js b/dist/demo.js index 53aa18110a..23ac2d8f2c 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -7561,6 +7561,11 @@ Demo.Item = BI.inherit(BI.Widget, { } }, + shouldUpdate: function (nextProps) { + var o = this.options; + return o.type !== nextProps.type || o.key !== nextProps.key || o.value !== nextProps.value; + }, + update: function (item) { this.label.setText(item.value); console.log("更新了一项");