select add global setting #5592
This commit is contained in:
parent
b265d61178
commit
5fe59e3ab2
4 changed files with 44 additions and 4 deletions
|
@ -39,7 +39,7 @@
|
|||
|
||||
ref="input">
|
||||
<Icon type="ios-close-circle" :class="[prefixCls + '-arrow']" v-if="resetSelect" @click.native.stop="onClear"></Icon>
|
||||
<Icon type="ios-arrow-down" :class="[prefixCls + '-arrow']" v-if="!resetSelect && !remote"></Icon>
|
||||
<Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" :class="[prefixCls + '-arrow']" v-if="!resetSelect && !remote"></Icon>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -174,6 +174,41 @@
|
|||
return {
|
||||
[`${prefixCls}-head-flex`]: this.filterable && (this.$slots.prefix || this.prefix)
|
||||
};
|
||||
},
|
||||
// 3.4.0, global setting customArrow 有值时,arrow 赋值空
|
||||
arrowType () {
|
||||
let type = 'ios-arrow-down';
|
||||
|
||||
if (this.$IVIEW) {
|
||||
if (this.$IVIEW.select.customArrow) {
|
||||
type = '';
|
||||
} else if (this.$IVIEW.select.arrow) {
|
||||
type = this.$IVIEW.select.arrow;
|
||||
}
|
||||
}
|
||||
return type;
|
||||
},
|
||||
// 3.4.0, global setting
|
||||
customArrowType () {
|
||||
let type = '';
|
||||
|
||||
if (this.$IVIEW) {
|
||||
if (this.$IVIEW.select.customArrow) {
|
||||
type = this.$IVIEW.select.customArrow;
|
||||
}
|
||||
}
|
||||
return type;
|
||||
},
|
||||
// 3.4.0, global setting
|
||||
arrowSize () {
|
||||
let size = '';
|
||||
|
||||
if (this.$IVIEW) {
|
||||
if (this.$IVIEW.select.arrowSize) {
|
||||
size = this.$IVIEW.select.arrowSize;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -168,7 +168,12 @@ const install = function(Vue, opts = {}) {
|
|||
|
||||
Vue.prototype.$IVIEW = {
|
||||
size: opts.size || '',
|
||||
transfer: 'transfer' in opts ? opts.transfer : ''
|
||||
transfer: 'transfer' in opts ? opts.transfer : '',
|
||||
select: {
|
||||
arrow: opts.select ? opts.select.arrow ? opts.select.arrow : '' : '', // 下拉箭头图标
|
||||
customArrow: opts.select ? opts.select.customArrow ? opts.select.customArrow : '' : '', // 自定义下拉箭头图标,优先显示
|
||||
arrowSize: opts.select ? opts.select.arrowSize ? opts.select.arrowSize : '' : '' // 下拉箭头字号
|
||||
}
|
||||
};
|
||||
|
||||
Vue.prototype.$Loading = LoadingBar;
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
}
|
||||
|
||||
.@{select-prefix-cls}-arrow {
|
||||
transform: rotate(180deg);
|
||||
transform: translateY(-50%) rotate(180deg);
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
top: 50%;
|
||||
right: 8px;
|
||||
line-height: 1;
|
||||
margin-top: -7px;
|
||||
transform: translateY(-50%);
|
||||
font-size: @font-size-base;
|
||||
color: @subsidiary-color;
|
||||
transition: all @transition-time @ease-in-out;
|
||||
|
|
Loading…
Add table
Reference in a new issue