vue3使用arco的树(tree)组件自定义node结点显示
arco.design组件库的实践踩坑记录总结.
·
使用arco.design组件
<a-tree
:data="treeData"
:default-expanded-keys="['0-0-0']"
:default-selected-keys="['0-0-0', '0-0-1']"
>
<template #extra="nodeData">(20人{{ nodeData.title }})</template>
</a-tree>
变量定义 setup中
const treeData = [
{
title: 'Trunk 0-0',
key: '0-0',
children: [
{
title: 'Branch 0-0-0',
key: '0-0-0',
disabled: true,
children: [
{
title: 'Leaf',
key: '0-0-0-0',
},
{
title: 'Leaf',
key: '0-0-0-1',
}
]
},
{
title: 'Branch 0-0-1',
key: '0-0-1',
children: [
{
title: 'Leaf',
key: '0-0-1-0',
},
]
},
],
},
];
完成结果
更多推荐
已为社区贡献36条内容
所有评论(0)