Transfer add new prop reverseOperation
This commit is contained in:
parent
69c439d65c
commit
4af3c4737e
2 changed files with 26 additions and 8 deletions
|
@ -1,11 +1,21 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="prefixCls + '-operation'">
|
<div :class="prefixCls + '-operation'">
|
||||||
|
<template v-if="reverseOperation">
|
||||||
|
<i-button type="primary" size="small" :disabled="!leftActive" @click.native="moveToRight">
|
||||||
|
<span>{{ operations[1] }}</span> <Icon type="ios-arrow-forward"></Icon>
|
||||||
|
</i-button>
|
||||||
|
<i-button type="primary" size="small" :disabled="!rightActive" @click.native="moveToLeft">
|
||||||
|
<Icon type="ios-arrow-back"></Icon> <span>{{ operations[0] }}</span>
|
||||||
|
</i-button>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<i-button type="primary" size="small" :disabled="!rightActive" @click.native="moveToLeft">
|
<i-button type="primary" size="small" :disabled="!rightActive" @click.native="moveToLeft">
|
||||||
<Icon type="ios-arrow-back"></Icon> <span>{{ operations[0] }}</span>
|
<Icon type="ios-arrow-back"></Icon> <span>{{ operations[0] }}</span>
|
||||||
</i-button>
|
</i-button>
|
||||||
<i-button type="primary" size="small" :disabled="!leftActive" @click.native="moveToRight">
|
<i-button type="primary" size="small" :disabled="!leftActive" @click.native="moveToRight">
|
||||||
<span>{{ operations[1] }}</span> <Icon type="ios-arrow-forward"></Icon>
|
<span>{{ operations[1] }}</span> <Icon type="ios-arrow-forward"></Icon>
|
||||||
</i-button>
|
</i-button>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -19,7 +29,8 @@
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
operations: Array,
|
operations: Array,
|
||||||
leftActive: Boolean,
|
leftActive: Boolean,
|
||||||
rightActive: Boolean
|
rightActive: Boolean,
|
||||||
|
reverseOperation: Boolean
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
moveToLeft () {
|
moveToLeft () {
|
||||||
|
|
|
@ -57,7 +57,8 @@
|
||||||
prefixCls: this.prefixCls,
|
prefixCls: this.prefixCls,
|
||||||
operations: this.operations,
|
operations: this.operations,
|
||||||
leftActive: this.leftValidKeysCount > 0,
|
leftActive: this.leftValidKeysCount > 0,
|
||||||
rightActive: this.rightValidKeysCount > 0
|
rightActive: this.rightValidKeysCount > 0,
|
||||||
|
reverseOperation: this.reverseOperation
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
@ -138,6 +139,12 @@
|
||||||
},
|
},
|
||||||
notFoundText: {
|
notFoundText: {
|
||||||
type: String
|
type: String
|
||||||
|
},
|
||||||
|
// 4.2.0
|
||||||
|
// 反转两个按钮
|
||||||
|
reverseOperation: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue