You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/examples/App.vue

52 lines
1.4 KiB

<template>
3 years ago
<a-directory-tree
3 years ago
v-model:expandedKeys="expandedKeys"
v-model:selectedKeys="selectedKeys"
3 years ago
multiple
:tree-data1="treeData"
3 years ago
>
<a-tree-node key="0-0" title="ddd" class="test" style="color: red">
<template #title="{ title }">{{ title }}</template>
3 years ago
<a-tree-node key="0-0-0" title="leaf 0-0" is-leaf />
<a-tree-node key="0-0-1" title="leaf 0-1" is-leaf />
</a-tree-node>
<a-tree-node key="0-1" title="parent 1">
<a-tree-node key="0-1-0" title="leaf 1-0" is-leaf />
<a-tree-node key="0-1-1" title="leaf 1-1" is-leaf />
</a-tree-node>
</a-directory-tree>
</template>
3 years ago
<script lang="ts">
import { defineComponent, ref, watch } from 'vue';
3 years ago
export default defineComponent({
setup() {
const expandedKeys = ref<string[]>([]);
3 years ago
const selectedKeys = ref<string[]>([]);
const treeData = [
{
title: 'parent 0',
key: '0-0',
children: [
{ title: 'leaf 0-0', key: '0-0-0', isLeaf: true },
// { title: 'leaf 0-1', key: '0-0-1', isLeaf: true },
],
},
{
title: 'parent 1',
key: '0-1',
children: [
{ title: 'leaf 1-0', key: '0-1-0', isLeaf: true },
{ title: 'leaf 1-1', key: '0-1-1', isLeaf: true },
],
},
];
3 years ago
return {
expandedKeys,
selectedKeys,
3 years ago
onTest: () => {},
treeData,
3 years ago
};
},
});
</script>