Commit 38b5b76051da0a675692b5da9af21d8ce23e7a43

Authored by 梁灏
1 parent 7435abb0

update Select max-tag-placeholder type to Function, #5568

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
1 1 {
2 2 "name": "iview",
3   - "version": "3.3.3",
  3 + "version": "3.4.0-rc.2",
4 4 "title": "iView",
5 5 "description": "A high quality UI components Library with Vue.js",
6 6 "homepage": "http://www.iviewui.com",
... ...
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 () {
... ...
src/components/select/select.vue
... ... @@ -251,7 +251,7 @@
251 251 },
252 252 // 3.4.0
253 253 maxTagPlaceholder: {
254   - type: String
  254 + type: Function
255 255 }
256 256 },
257 257 mounted(){
... ...