提交 bf287ac9 编写于 作者: yubinCloud's avatar yubinCloud

8-9 让表格树默认展开,利用给组件加一个 v-if 判断使得当真正有数据时才允许 Ant Design 进行渲染,防止初始因为数据为空而渲染失败

上级 2cc7b116
......@@ -20,12 +20,14 @@
</a-form>
</p>
<a-table
v-if="level1.length > 0"
:columns="columns"
:row-key="record => record.id"
:data-source="level1"
:loading="loading"
:pagination="false"
size="small"
:defaultExpandAllRows="true"
>
<template #name="{ text, record }">
{{ record.sort }} {{ text }}
......@@ -147,6 +149,7 @@ export default defineComponent({
* }]
*/
const level1 = ref(); // 一级文档树,children属性就是二级文档
level1.value = [];
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册