fix[DragSelect]: fixed querySelectorAll bug

pull/2374/head
Pan 6 years ago
parent 9f1552d98f
commit a0862ca547

@ -1,5 +1,5 @@
<template>
<el-select v-model="selectVal" v-bind="$attrs" class="drag-select" multiple>
<el-select ref="dragSelect" v-model="selectVal" v-bind="$attrs" class="drag-select" multiple>
<slot/>
</el-select>
</template>
@ -30,7 +30,7 @@ export default {
},
methods: {
setSort() {
const el = document.querySelectorAll('.el-select__tags > span')[0]
const el = this.$refs.dragSelect.$el.querySelectorAll('.el-select__tags > span')[0]
this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
setData: function(dataTransfer) {

Loading…
Cancel
Save