he-tree
he-tree copied to clipboard
Pro version - example not working
The example given with the Pro version isn't working because it's written for the old version of the plugin:
import {Tree, // Base tree
Fold, Check, Draggable, // plugins
} from 'he-tree-vue'
import 'he-tree-vue/dist/he-tree-vue.css' // base style
import DraggablePro from 'yourpath/DraggablePro.vue'
DraggablePro.LICENSE_NUMBER = 'your license number'
export default {
components: {
Tree: Tree.mixPlugins([Fold, Check, Draggable, DraggablePro]),
},
}
Specifically, this has to be replaced:
import {Tree, // Base tree
Fold, Check, Draggable, // plugins
} from 'he-tree-vue'
with this:
import {Tree, Draggable, BaseTree} from '@he-tree/vue2';
And then BaseTree doesn't have mixPlugins method.
Please give instructions on how to use it with https://github.com/phphe/he-tree/ Vue 2.
I've figured it out - create new Tree.vue component:
<script>
import { BaseTree, Draggable } from "@he-tree/vue2";
import DraggablePro from "@/view/components/DraggablePro";
import '@he-tree/vue2/dist/he-tree-vue2.css';
export default {
extends: BaseTree,
mixins: [Draggable, DraggablePro]
}
</script>