diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue
index 00e7176..8573878 100644
--- a/src/components/IPTV.vue
+++ b/src/components/IPTV.vue
@@ -40,6 +40,7 @@ import { iptv, iptvSearch } from '../lib/dexie'
import { iptv as defaultSites } from '../lib/dexie/initData'
import { remote } from 'electron'
import fs from 'fs'
+import Sortable from 'sortablejs'
export default {
name: 'iptv',
data () {
@@ -228,44 +229,25 @@ export default {
ele.id = id
id += 1
})
+ },
+ rowDrop () {
+ const tbody = document.getElementById('iptv-table').querySelector('.el-table__body-wrapper tbody')
+ const _this = this
+ Sortable.create(tbody, {
+ onEnd ({ newIndex, oldIndex }) {
+ const currRow = _this.iptvList.splice(oldIndex, 1)[0]
+ _this.iptvList.splice(newIndex, 0, currRow)
+ _this.updateDatabase(_this.iptvList)
+ }
+ })
}
},
+ mounted () {
+ this.rowDrop()
+ },
created () {
this.getSites()
this.getSearchList()
}
}
-
diff --git a/src/components/Star.vue b/src/components/Star.vue
index f9f8387..7613a82 100644
--- a/src/components/Star.vue
+++ b/src/components/Star.vue
@@ -7,7 +7,7 @@