Commit 3fd978800fb1d3e9d84c15cac13271836ed868cb

Authored by 梁灏
1 parent 8f48491a

Transfer renderFormat support html element

Transfer renderFormat support html element
src/components/transfer/list.vue
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 :class="itemClasses(item)" 18 :class="itemClasses(item)"
19 @click.prevent="select(item)"> 19 @click.prevent="select(item)">
20 <Checkbox :checked="isCheck(item)" :disabled="item.disabled"></Checkbox> 20 <Checkbox :checked="isCheck(item)" :disabled="item.disabled"></Checkbox>
21 - <span>{{ showLabel(item) }}</span> 21 + <span>{{{ showLabel(item) }}}</span>
22 </li> 22 </li>
23 <li :class="prefixCls + '-content-not-found'">{{ notFoundText }}</li> 23 <li :class="prefixCls + '-content-not-found'">{{ notFoundText }}</li>
24 </ul> 24 </ul>
test/routers/transfer.vue
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 :data="data2" 3 :data="data2"
4 :target-keys="targetKeys2" 4 :target-keys="targetKeys2"
5 filterable 5 filterable
  6 + :render-format="rf"
6 :filter-method="filterMethod" 7 :filter-method="filterMethod"
7 @on-change="handleChange2"></Transfer> 8 @on-change="handleChange2"></Transfer>
8 </template> 9 </template>
@@ -37,6 +38,9 @@ @@ -37,6 +38,9 @@
37 }, 38 },
38 filterMethod (data, query) { 39 filterMethod (data, query) {
39 return data.label.indexOf(query) > -1; 40 return data.label.indexOf(query) > -1;
  41 + },
  42 + rf (data) {
  43 + return '<i class="ivu-icon ivu-icon-alert"></i>' + data.label;
40 } 44 }
41 } 45 }
42 } 46 }