فهرست منبع

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

invalid w 1 سال پیش
والد
کامیت
e4bcf8c899
2فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 1 0
      src/views/demo/tree/data.ts
  2. 4 1
      src/views/demo/tree/index.vue

+ 1 - 0
src/views/demo/tree/data.ts

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

+ 4 - 1
src/views/demo/tree/index.vue

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