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,7 +24,7 @@
24 <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option> 24 <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
25 </Select> 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 <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option> 28 <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
29 </Select> 29 </Select>
30 30
@@ -82,6 +82,11 @@ @@ -82,6 +82,11 @@
82 model1: '', 82 model1: '',
83 model10: [] 83 model10: []
84 } 84 }
  85 + },
  86 + methods: {
  87 + more (num) {
  88 + return 'more' + num;
  89 + }
85 } 90 }
86 } 91 }
87 </script> 92 </script>
1 { 1 {
2 "name": "iview", 2 "name": "iview",
3 - "version": "3.3.3", 3 + "version": "3.4.0-rc.2",
4 "title": "iView", 4 "title": "iView",
5 "description": "A high quality UI components Library with Vue.js", 5 "description": "A high quality UI components Library with Vue.js",
6 "homepage": "http://www.iviewui.com", 6 "homepage": "http://www.iviewui.com",
src/components/select/select-head.vue
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <Icon type="ios-close" @click.native.stop="removeTag(item)"></Icon> 13 <Icon type="ios-close" @click.native.stop="removeTag(item)"></Icon>
14 </div><div class="ivu-tag ivu-tag-checked" v-if="maxTagCount !== undefined && selectedMultiple.length > maxTagCount"> 14 </div><div class="ivu-tag ivu-tag-checked" v-if="maxTagCount !== undefined && selectedMultiple.length > maxTagCount">
15 <span class="ivu-tag-text ivu-select-max-tag"> 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 <template v-else>+ {{ selectedMultiple.length - maxTagCount }}...</template> 17 <template v-else>+ {{ selectedMultiple.length - maxTagCount }}...</template>
18 </span> 18 </span>
19 </div> 19 </div>
@@ -100,7 +100,7 @@ @@ -100,7 +100,7 @@
100 }, 100 },
101 // 3.4.0 101 // 3.4.0
102 maxTagPlaceholder: { 102 maxTagPlaceholder: {
103 - type: String 103 + type: Function
104 } 104 }
105 }, 105 },
106 data () { 106 data () {
src/components/select/select.vue
@@ -251,7 +251,7 @@ @@ -251,7 +251,7 @@
251 }, 251 },
252 // 3.4.0 252 // 3.4.0
253 maxTagPlaceholder: { 253 maxTagPlaceholder: {
254 - type: String 254 + type: Function
255 } 255 }
256 }, 256 },
257 mounted(){ 257 mounted(){