From 36ccadfe5c0a7f61cb707119668aecd0332fbff7 Mon Sep 17 00:00:00 2001 From: hale Date: Fri, 30 Mar 2018 16:45:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?misc:=20isCaseSensitive=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=80=BC=E6=84=8F=E6=80=9D=E5=86=99=E5=8F=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/components/form/KLSelect/index.js | 2 +- src/js/components/form/KLSelect/plugins/private.method.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/components/form/KLSelect/index.js b/src/js/components/form/KLSelect/index.js index d0efb874..6b3be6f9 100644 --- a/src/js/components/form/KLSelect/index.js +++ b/src/js/components/form/KLSelect/index.js @@ -66,7 +66,7 @@ const KLSelect = Dropdown.extend({ canSearch: undefined, filter: null, // 默认不区分大小写 - isCaseSensitive: true, + isCaseSensitive: false, noMatchText: this.$trans('NO_MATCH'), delaySearch: 300, maxShowCount: 1000, diff --git a/src/js/components/form/KLSelect/plugins/private.method.js b/src/js/components/form/KLSelect/plugins/private.method.js index 06e705c2..da1d97fd 100644 --- a/src/js/components/form/KLSelect/plugins/private.method.js +++ b/src/js/components/form/KLSelect/plugins/private.method.js @@ -43,10 +43,10 @@ module.exports = function PrivateMethod(Component) { let searchValue = (data.searchValue || '').trim(); const maxShowCount = data.maxShowCount; const isCaseSensitive = data.isCaseSensitive; - searchValue = isCaseSensitive ? searchValue.toLowerCase() : searchValue; + searchValue = isCaseSensitive ? searchValue : searchValue.toLowerCase(); let targetSource = source.filter((item, index) => { const text = `${item[nameKey]}`; - const value = isCaseSensitive ? text.toLowerCase() : text; + const value = isCaseSensitive ? text : text.toLowerCase(); return ( (searchValue && value.indexOf(searchValue) >= 0) || (!searchValue && index < maxShowCount) From 9054b1fdb087346f8609cc417c80ff56eeee1376 Mon Sep 17 00:00:00 2001 From: hale Date: Fri, 30 Mar 2018 17:37:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?misc:=20isCaseSensitive=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=80=BC=E6=84=8F=E6=80=9D=E5=86=99=E5=8F=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/components/form/KLSelect/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/components/form/KLSelect/index.md b/src/js/components/form/KLSelect/index.md index 36aba77e..ffede34c 100644 --- a/src/js/components/form/KLSelect/index.md +++ b/src/js/components/form/KLSelect/index.md @@ -345,8 +345,8 @@ var component = new NEKUI.Component({ value: '', limit: null, source: [ - {name: '母婴儿童123'},{name: '母婴儿童12'}, - {name: '母婴儿童1'},{name: '母婴儿童'}, + {name: '母婴儿童Dr.CI'},{name: '母婴儿童Filorga'}, + {name: '母婴儿童age20'},{name: '母婴儿童'}, {name: '营养保健'},{name: '海外直邮'}, {name: '数码家电'},{name: '环球美食'}, {name: '运动户外'},{name: '水果生鲜'},