fix[DragSelect]: fixed querySelectorAll bug
This commit is contained in:
parent
8e5b142c36
commit
8921752441
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<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/>
|
<slot/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -30,7 +30,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setSort() {
|
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, {
|
this.sortable = Sortable.create(el, {
|
||||||
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
||||||
setData: function(dataTransfer) {
|
setData: function(dataTransfer) {
|
||||||
|
|
Loading…
Reference in New Issue