Commit f10b27f99dfd3877b8f837f7631f7f362efd5dc0
1 parent
393d8551
update Select
Showing
2 changed files
with
8 additions
and
3 deletions
Show diff stats
examples/routers/select.vue
| @@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
| 82 | return item.label.toLowerCase() | 82 | return item.label.toLowerCase() |
| 83 | .indexOf(query.toLowerCase()) > -1; | 83 | .indexOf(query.toLowerCase()) > -1; |
| 84 | }); | 84 | }); |
| 85 | - }, 500); | 85 | + }, 200); |
| 86 | } else { | 86 | } else { |
| 87 | this.options = []; | 87 | this.options = []; |
| 88 | } | 88 | } |
src/components/select/select.vue
| @@ -630,7 +630,8 @@ | @@ -630,7 +630,8 @@ | ||
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | if (this.filterable) { | 632 | if (this.filterable) { |
| 633 | - this.selectToChangeQuery = true; | 633 | + // remote&filterable&multiple时,一次点多项,不应该设置true,因为无法置为false,下次的搜索会失效 |
| 634 | + if (this.query !== '') this.selectToChangeQuery = true; | ||
| 634 | this.query = ''; | 635 | this.query = ''; |
| 635 | this.$refs.input.focus(); | 636 | this.$refs.input.focus(); |
| 636 | } | 637 | } |
| @@ -640,7 +641,7 @@ | @@ -640,7 +641,7 @@ | ||
| 640 | if (this.filterable) { | 641 | if (this.filterable) { |
| 641 | this.findChild((child) => { | 642 | this.findChild((child) => { |
| 642 | if (child.value === value) { | 643 | if (child.value === value) { |
| 643 | - this.selectToChangeQuery = true; | 644 | + if (this.query !== '') this.selectToChangeQuery = true; |
| 644 | this.query = child.label === undefined ? child.searchLabel : child.label; | 645 | this.query = child.label === undefined ? child.searchLabel : child.label; |
| 645 | } | 646 | } |
| 646 | }); | 647 | }); |
| @@ -702,6 +703,10 @@ | @@ -702,6 +703,10 @@ | ||
| 702 | this.$emit('on-query-change', val); | 703 | this.$emit('on-query-change', val); |
| 703 | this.remoteMethod(val); | 704 | this.remoteMethod(val); |
| 704 | } | 705 | } |
| 706 | + this.focusIndex = 0; | ||
| 707 | + this.findChild(child => { | ||
| 708 | + child.isFocus = false; | ||
| 709 | + }); | ||
| 705 | } else { | 710 | } else { |
| 706 | if (!this.selectToChangeQuery) { | 711 | if (!this.selectToChangeQuery) { |
| 707 | this.$emit('on-query-change', val); | 712 | this.$emit('on-query-change', val); |