chore: 🤖 migrate to vue cli 3

This commit is contained in:
Binbin Sun
2019-12-27 14:14:34 +08:00
parent 0723294c7b
commit 4b8bbcbfde
14 changed files with 11508 additions and 172 deletions

View File

@@ -88,12 +88,15 @@
</template>
<script>
import { Tree, TreeNode } from './Tree.js'
import { TreeNode } from './Tree.js'
import { addHandler, removeHandler } from './tools.js'
let compInOperation = null
export default {
components: {
item: () => import('./VueTreeList')
},
data: function () {
return {
isHover: false,
@@ -196,12 +199,12 @@
}
},
mouseOver(e) {
mouseOver() {
if (this.model.disabled) return
this.isHover = true
},
mouseOut(e) {
mouseOut() {
this.isHover = false
},
@@ -229,22 +232,22 @@
}
return false
},
dragEnd(e) {
dragEnd() {
compInOperation = null
},
dragOver(e) {
e.preventDefault()
return true
},
dragEnter(e) {
dragEnter() {
if (!compInOperation) return
if (this.model.isLeaf) return
this.isDragEnterNode = true
},
dragLeave(e) {
dragLeave() {
this.isDragEnterNode = false
},
drop(e) {
drop() {
if (!compInOperation) return
const oldParent = compInOperation.model.parent;
compInOperation.model.moveInto(this.model)
@@ -301,9 +304,6 @@
}
return node;
}
},
beforeCreate () {
this.$options.components.item = require('./VueTreeList.vue')
}
}
</script>