提交 | 用户 | 时间
|
820397
|
1 |
import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' |
H |
2 |
import { cloneDeep } from 'lodash-es' |
|
3 |
|
|
4 |
/** 列表导航属性 */ |
|
5 |
export interface MenuListProperty { |
|
6 |
// 导航菜单列表 |
|
7 |
list: MenuListItemProperty[] |
|
8 |
// 组件样式 |
|
9 |
style: ComponentStyle |
|
10 |
} |
|
11 |
|
|
12 |
/** 列表导航项目属性 */ |
|
13 |
export interface MenuListItemProperty { |
|
14 |
// 图标链接 |
|
15 |
iconUrl: string |
|
16 |
// 标题 |
|
17 |
title: string |
|
18 |
// 标题颜色 |
|
19 |
titleColor: string |
|
20 |
// 副标题 |
|
21 |
subtitle: string |
|
22 |
// 副标题颜色 |
|
23 |
subtitleColor: string |
|
24 |
// 链接 |
|
25 |
url: string |
|
26 |
} |
|
27 |
|
|
28 |
export const EMPTY_MENU_LIST_ITEM_PROPERTY = { |
|
29 |
title: '标题', |
|
30 |
titleColor: '#333', |
|
31 |
subtitle: '副标题', |
|
32 |
subtitleColor: '#bbb' |
|
33 |
} |
|
34 |
|
|
35 |
// 定义组件 |
|
36 |
export const component = { |
|
37 |
id: 'MenuList', |
|
38 |
name: '列表导航', |
|
39 |
icon: 'fa-solid:list', |
|
40 |
property: { |
|
41 |
list: [cloneDeep(EMPTY_MENU_LIST_ITEM_PROPERTY)], |
|
42 |
style: { |
|
43 |
bgType: 'color', |
|
44 |
bgColor: '#fff', |
|
45 |
marginBottom: 8 |
|
46 |
} as ComponentStyle |
|
47 |
} |
|
48 |
} as DiyComponent<MenuListProperty> |