Commit 38b5b76051da0a675692b5da9af21d8ce23e7a43
1 parent
7435abb0
update Select max-tag-placeholder type to Function, #5568
Showing
4 changed files
with
10 additions
and
5 deletions
Show diff stats
examples/routers/select.vue
| ... | ... | @@ -24,7 +24,7 @@ |
| 24 | 24 | <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option> |
| 25 | 25 | </Select> |
| 26 | 26 | |
| 27 | - <Select v-model="model10" :max-tag-count="3" max-tag-placeholder="more" multiple style="width:400px" prefix="ios-albums"> | |
| 27 | + <Select v-model="model10" :max-tag-count="3" :max-tag-placeholder="more" multiple style="width:400px" prefix="ios-albums"> | |
| 28 | 28 | <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option> |
| 29 | 29 | </Select> |
| 30 | 30 | |
| ... | ... | @@ -82,6 +82,11 @@ |
| 82 | 82 | model1: '', |
| 83 | 83 | model10: [] |
| 84 | 84 | } |
| 85 | + }, | |
| 86 | + methods: { | |
| 87 | + more (num) { | |
| 88 | + return 'more' + num; | |
| 89 | + } | |
| 85 | 90 | } |
| 86 | 91 | } |
| 87 | 92 | </script> | ... | ... |
package.json
src/components/select/select-head.vue
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | <Icon type="ios-close" @click.native.stop="removeTag(item)"></Icon> |
| 14 | 14 | </div><div class="ivu-tag ivu-tag-checked" v-if="maxTagCount !== undefined && selectedMultiple.length > maxTagCount"> |
| 15 | 15 | <span class="ivu-tag-text ivu-select-max-tag"> |
| 16 | - <template v-if="maxTagPlaceholder">{{ maxTagPlaceholder }}</template> | |
| 16 | + <template v-if="maxTagPlaceholder">{{ maxTagPlaceholder(selectedMultiple.length - maxTagCount) }}</template> | |
| 17 | 17 | <template v-else>+ {{ selectedMultiple.length - maxTagCount }}...</template> |
| 18 | 18 | </span> |
| 19 | 19 | </div> |
| ... | ... | @@ -100,7 +100,7 @@ |
| 100 | 100 | }, |
| 101 | 101 | // 3.4.0 |
| 102 | 102 | maxTagPlaceholder: { |
| 103 | - type: String | |
| 103 | + type: Function | |
| 104 | 104 | } |
| 105 | 105 | }, |
| 106 | 106 | data () { | ... | ... |