Commit d200ad43 authored by linhuandong's avatar linhuandong

增加穿梭组件上下移事件

parent 6c98733d
......@@ -203,12 +203,14 @@ export default {
let oldIndex = this.value.indexOf(currentItem[this.props.key]);
let newIndex = oldIndex - 1;
this.value.splice(newIndex, 0, this.value.splice(oldIndex, 1)[0]);
this.$emit('move', { oldIndex, newIndex, currentItem, type: 'up' });
},
moveDown() {
let currentItem = this.$refs.rightPanel.getCurrentItem();
let oldIndex = this.value.indexOf(currentItem[this.props.key]);
let newIndex = oldIndex + 1;
this.value.splice(newIndex, 0, this.value.splice(oldIndex, 1)[0]);
this.$emit('move', { oldIndex, newIndex, currentItem, type: 'down' });
},
addToLeft() {
let currentValue = this.value.slice();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment