From 7133c8982a8fc2dbeee09fee3d3aab99ff0d6adc Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Wed, 18 Nov 2020 15:51:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4iptv=E6=8B=96=E6=8B=BD?= =?UTF-8?q?=E4=BB=85=E5=9C=A8"=E4=B8=8D=E5=8F=AF=E5=B1=95=E5=BC=80"?= =?UTF-8?q?=E5=8D=B3=E6=89=B9=E5=A4=84=E7=90=86=E6=A8=A1=E5=BC=8F=E5=8F=AF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/IPTV.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue index 00a1518..6d280b4 100644 --- a/src/components/IPTV.vue +++ b/src/components/IPTV.vue @@ -132,6 +132,7 @@ export default { checkAllChannelsLoading: false, checkProgress: 0, stopFlag: false, + sortableTable: '', show: { search: false } @@ -193,6 +194,9 @@ export default { this.$nextTick(() => { this.expandedRows.forEach(e => this.$refs.iptvTable.toggleRowExpansion(e, false)) }) + this.rowDrop() + } else { + this.sortableTable.destroy() } } }, @@ -532,7 +536,7 @@ export default { } const tbody = document.getElementById('iptv-table').querySelector('.el-table__body-wrapper tbody') const _this = this - Sortable.create(tbody, { + this.sortableTable = new Sortable(tbody, { filter: '.el-table__row--level-1', // 禁止children拖动 onEnd ({ newIndex, oldIndex }) { const currRow = _this.channelList.splice(oldIndex, 1)[0] @@ -627,7 +631,6 @@ export default { } }, mounted () { - this.rowDrop() addEventListener('keydown', code => { if (code.keyCode === 16) this.shiftDown = true }) addEventListener('keyup', code => { if (code.keyCode === 16) this.shiftDown = false }) },