From eb987bbbd5ea2888d5d0281758615b5a0fd07584 Mon Sep 17 00:00:00 2001 From: "Rocky Zhang (rockyzh)" Date: Tue, 13 Oct 2015 15:20:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=B9=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E9=A1=B9repeat=E6=97=B6=EF=BC=8C=E5=8F=98?= =?UTF-8?q?=E6=8D=A2=E4=B8=8B=E6=A0=87=E4=B8=8D=E8=83=BD=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=9B=B4=E6=96=B0=EF=BC=8C=E5=8F=8A=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=89=8D=E5=90=8E=E6=95=B0=E7=BB=84=E9=95=BF=E5=BA=A6?= =?UTF-8?q?=E4=B8=80=E6=A0=B7=E6=97=B6=E4=B8=8D=E8=83=BD=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/19 directive/repeat.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/19 directive/repeat.js b/src/19 directive/repeat.js index 912696036..479da48ae 100644 --- a/src/19 directive/repeat.js +++ b/src/19 directive/repeat.js @@ -29,6 +29,9 @@ bindingHandlers.repeat = function (data, vmodels) { } } + data.handler = noop + avalon.injectBinding(data) + var elem = data.element if (elem.nodeType === 1) { elem.removeAttribute(data.name) @@ -97,7 +100,12 @@ bindingExecutors.repeat = function (method, pos, el) { if (data.xtype === "array") { if (old.length === neo.length) { - return + if (old != neo && old.length > 0) { + arguments.callee.call(this, 'clear', pos, el) + } + else { + return + } } method = "add" pos = 0