feat: 扩展 ConfigType,以支持虚拟图标组件

This commit is contained in:
tnt group 2023-05-18 19:41:30 +08:00
parent 6fee63600b
commit 816c11a877
2 changed files with 4 additions and 1 deletions

View File

@ -28,6 +28,7 @@ export type ConfigType = {
dataset?: any // 组件预设的 dataset 值 dataset?: any // 组件预设的 dataset 值
disabled?: boolean // 禁用的 disabled?: boolean // 禁用的
clickHandle?: Function // 单击事件 clickHandle?: Function // 单击事件
icon?: string // 图标
} }
// 数据请求 // 数据请求

View File

@ -23,7 +23,8 @@
</n-text> </n-text>
</div> </div>
<div class="list-center go-flex-center go-transition"> <div class="list-center go-flex-center go-transition">
<chart-glob-image class="list-img" :chartConfig="item"></chart-glob-image> <Icon v-if="item.icon" class="list-img" :icon="item.icon" color="#999" width="48" />
<chart-glob-image v-else class="list-img" :chartConfig="item" />
</div> </div>
<div class="list-bottom"> <div class="list-bottom">
<n-text class="list-bottom-text" depth="3"> <n-text class="list-bottom-text" depth="3">
@ -48,6 +49,7 @@ import { DragKeyEnum } from '@/enums/editPageEnum'
import { createComponent } from '@/packages' import { createComponent } from '@/packages'
import { ConfigType, CreateComponentType } from '@/packages/index.d' import { ConfigType, CreateComponentType } from '@/packages/index.d'
import { fetchConfigComponent, fetchChartComponent } from '@/packages/index' import { fetchConfigComponent, fetchChartComponent } from '@/packages/index'
import { Icon } from '@iconify/vue'
import omit from 'lodash/omit' import omit from 'lodash/omit'