From f6aedd0a1f924e31b1cefc34784cc8982ad1f4f2 Mon Sep 17 00:00:00 2001 From: liuxing <782593749@qq.com> Date: Tue, 6 Nov 2018 15:28:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?misc:=20=E5=B1=95=E7=A4=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/layout/KLTable/TDElements/templates/check.html | 2 +- .../components/layout/KLTable/THElements/templates/check.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/components/layout/KLTable/TDElements/templates/check.html b/src/js/components/layout/KLTable/TDElements/templates/check.html index 657974e3..e9848dda 100644 --- a/src/js/components/layout/KLTable/TDElements/templates/check.html +++ b/src/js/components/layout/KLTable/TDElements/templates/check.html @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/src/js/components/layout/KLTable/THElements/templates/check.html b/src/js/components/layout/KLTable/THElements/templates/check.html index 4a6adc97..4847e987 100644 --- a/src/js/components/layout/KLTable/THElements/templates/check.html +++ b/src/js/components/layout/KLTable/THElements/templates/check.html @@ -1,4 +1,4 @@ \ No newline at end of file + checked={item._checked || false} + on-change={this._onItemCheckChange(item, $event)}/> From e5f070b8230400fa69f56e00c480ca80a87e27e1 Mon Sep 17 00:00:00 2001 From: liuxing <782593749@qq.com> Date: Wed, 7 Nov 2018 15:15:45 +0800 Subject: [PATCH 2/2] fix: newValue undefined cause unexpected emit --- src/js/components/form/KLCheck/index.js | 3 +-- .../components/layout/KLTable/TDElements/templates/check.html | 2 +- .../components/layout/KLTable/THElements/templates/check.html | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/js/components/form/KLCheck/index.js b/src/js/components/form/KLCheck/index.js index 3b7975b8..66e12a2c 100644 --- a/src/js/components/form/KLCheck/index.js +++ b/src/js/components/form/KLCheck/index.js @@ -32,8 +32,7 @@ const KLCheck = Component.extend({ this.supr(); this.$watch('checked', function (newValue, oldValue) { - if (oldValue === undefined) return; - + if (oldValue === undefined || newValue === undefined) return; /** * @event KLCheck#change 选中状态改变时触发 * @property {object} sender 事件发送对象 diff --git a/src/js/components/layout/KLTable/TDElements/templates/check.html b/src/js/components/layout/KLTable/TDElements/templates/check.html index e9848dda..657974e3 100644 --- a/src/js/components/layout/KLTable/TDElements/templates/check.html +++ b/src/js/components/layout/KLTable/TDElements/templates/check.html @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/src/js/components/layout/KLTable/THElements/templates/check.html b/src/js/components/layout/KLTable/THElements/templates/check.html index 4847e987..aa43b718 100644 --- a/src/js/components/layout/KLTable/THElements/templates/check.html +++ b/src/js/components/layout/KLTable/THElements/templates/check.html @@ -1,4 +1,4 @@