This library is deprecated, please use the refactored virtual-tree
Based on the tree component encapsulated by vue3 and dedicated to large data volume, if the data volume is not large, using this component is a bit wasteful
English & 简体中文
npm i vue-virtual-tree
Global registration, but this will lose the type, if you use typescript, this method is not recommended
import { createApp } from 'vue';
import VirTree from 'vue-virtual-tree';
createApp(App).use(VirTree).mount('#app');
In components:
<vir-tree />
Partial registration, you can get a complete type
<template>
<div class="demo">
<vir-tree" :source="list" />
</div>
</template>
<script lang="tsx">
import {defineComponent, onMounted, ref} from 'vue';
import { VirTree, TreeNodeOptions } from 'vue-virtual-tree';
export default defineComponent({
name: 'BaseDemo',
components: { VirTree },
setup(props, {emit}) {
const list = ref<TreeNodeOptions[]>([]);
return {
list
}
}
});
</script>