Skip to content

Commit

Permalink
Merge pull request #499 from jiezai0920/master
Browse files Browse the repository at this point in the history
fix($emfe): fix select component bug
  • Loading branch information
jiezai0920 authored May 22, 2020
2 parents 65117ae + 13da15c commit f5927de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
5 changes: 4 additions & 1 deletion examples/esm/components/functions/SelectPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<br>

<h2>带搜索下拉框和加载更多:</h2>
<emfe-select :moreloading="true" :searchFlag="true" :datas="radio"></emfe-select>
<emfe-select :moreloading="true" :searchFlag="true" @search="searchFun" :datas="radio"></emfe-select>
<br>
<br>

Expand Down Expand Up @@ -367,6 +367,9 @@ export default {
getlist2(item) {
console.log('删除了:'+item);
},
searchFun() {
console.log('开始请求');
},
},
};
</script>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "em-fe",
"version": "2.9.6",
"version": "2.9.8",
"description": "快速开发产品的UI库",
"main": "dist/emfe.js",
"unpkg": "dist/emfe.js",
Expand Down
15 changes: 6 additions & 9 deletions src/components/emfe-select/src/EmfeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ export default {
type: String,
default: '搜索',
},
searchFun: {
type: Function,
default: () => {},
},
moreText: {
type: String,
default: '加载更多',
Expand Down Expand Up @@ -228,15 +232,8 @@ export default {
this.add(newdata, this.datas);
},
search() {
const keyWord = this.searchVal;
const dataList = [];
this.datas.forEach((item) => {
if (item.name.indexOf(keyWord) >= 0) {
dataList.push(item);
}
});
this.checkList = dataList.slice(0);
// this.$emit('search', keyWord, this.datas);
this.$emit('search', this.datas);
this.searchFun();
},
spanTxt(item, index) {
if (item.disabled !== 'disabled' && !item.disabled) {
Expand Down

0 comments on commit f5927de

Please sign in to comment.