update Cascader Icons

This commit is contained in:
梁灏 2018-06-25 13:30:40 +08:00
parent 0f512d6a73
commit 207d6b072b
3 changed files with 55 additions and 59 deletions

View file

@ -1,64 +1,60 @@
<template> <template>
<div> <Cascader :data="data4" :load-data="loadData"></Cascader>
<Cascader v-model="value3" :data="data" filterable style="width: 400px"></Cascader>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<Cascader v-model="value3" :data="data" filterable style="width: 400px"></Cascader>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<Cascader v-model="value3" :data="data" filterable style="width: 400px"></Cascader>
</div>
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
data: [{ data4: [
value: 1, {
label: '北京', value: 'beijing',
children: [ label: '北京',
{ children: [],
value: 11, loading: false
label: '故宫' },
}, {
{ value: 'hangzhou',
value: 12, label: '杭州',
label: '天坛' children: [],
}, loading:false
{ }
value: 13, ]
label: '王府井' }
} },
] methods: {
}, { loadData (item, callback) {
value: 2, item.loading = true;
label: '江苏', setTimeout(() => {
children: [ if (item.value === 'beijing') {
{ item.children = [
value: 21, {
label: '南京', value: 'talkingdata',
children: [ label: 'TalkingData'
{ },
value: 211, {
label: '夫子庙', value: 'baidu',
} label: '百度'
] },
}, {
{ value: 'sina',
value: 22, label: '新浪'
label: '苏州', }
children: [ ];
{ } else if (item.value === 'hangzhou') {
value: 221, item.children = [
label: '拙政园', {
}, value: 'ali',
{ label: '阿里巴巴'
value: 222, },
label: '狮子林', {
} value: '163',
] label: '网易'
} }
], ];
}], }
value3: [] item.loading = false;
callback();
}, 1000);
} }
} }
} }

View file

@ -16,8 +16,8 @@
:class="[prefixCls + '-label']" :class="[prefixCls + '-label']"
v-show="filterable && query === ''" v-show="filterable && query === ''"
@click="handleFocus">{{ displayRender }}</div> @click="handleFocus">{{ displayRender }}</div>
<Icon type="ios-close" :class="[prefixCls + '-arrow']" v-show="showCloseIcon" @click.native.stop="clearSelect"></Icon> <Icon type="ios-close-circle" :class="[prefixCls + '-arrow']" v-show="showCloseIcon" @click.native.stop="clearSelect"></Icon>
<Icon type="arrow-down-b" :class="[prefixCls + '-arrow']"></Icon> <Icon type="ios-arrow-down" :class="[prefixCls + '-arrow']"></Icon>
</slot> </slot>
</div> </div>
<transition name="transition-drop"> <transition name="transition-drop">

View file

@ -1,8 +1,8 @@
<template> <template>
<li :class="classes"> <li :class="classes">
{{ data.label }} {{ data.label }}
<i v-if="showArrow" class="ivu-icon ivu-icon-ios-arrow-right"></i> <i v-if="showArrow" class="ivu-icon ivu-icon-ios-arrow-forward"></i>
<i v-if="showLoading" class="ivu-icon ivu-icon-load-c ivu-load-loop"></i> <i v-if="showLoading" class="ivu-icon ivu-icon-ios-sync ivu-load-loop"></i>
</li> </li>
</template> </template>
<script> <script>