chore(demo): basicTree组件增加icon 和 switcherIcon示例

This commit is contained in:
invalid w 2023-10-21 11:49:17 +08:00
parent a0b2a9e949
commit e4bcf8c899
2 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@ export const treeData: TreeItem[] = [
{ {
title: 'parent ', title: 'parent ',
key: '0-0', key: '0-0',
icon: 'ion:settings-outline',
children: [ children: [
{ title: 'leaf', key: '0-0-0' }, { title: 'leaf', key: '0-0-0' },
{ {

View File

@ -3,7 +3,9 @@
<Row :gutter="[16, 16]"> <Row :gutter="[16, 16]">
<Col :span="8"> <Col :span="8">
<BasicTree title="基础示例,默认展开第一层" :treeData="treeData" defaultExpandLevel="1"> <BasicTree title="基础示例,默认展开第一层" :treeData="treeData" defaultExpandLevel="1">
<template #title> 123123 </template> <template #icon><SmileTwoTone /></template>
<template #title>666</template>
<template #switcherIcon> <CarryOutOutlined /></template>
</BasicTree> </BasicTree>
</Col> </Col>
<Col :span="8"> <Col :span="8">
@ -62,6 +64,7 @@
import { cloneDeep, uniq } from 'lodash-es'; import { cloneDeep, uniq } from 'lodash-es';
import { isArray } from '/@/utils/is'; import { isArray } from '/@/utils/is';
import { type Nullable } from '@vben/types'; import { type Nullable } from '@vben/types';
import { SmileTwoTone, CarryOutOutlined } from '@ant-design/icons-vue';
const asyncTreeRef = ref<Nullable<TreeActionType>>(null); const asyncTreeRef = ref<Nullable<TreeActionType>>(null);
const asyncExpandTreeRef = ref<Nullable<TreeActionType>>(null); const asyncExpandTreeRef = ref<Nullable<TreeActionType>>(null);