forked from alibaba/lowcode-materials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnippets.design.ts
More file actions
61 lines (56 loc) · 1.46 KB
/
snippets.design.ts
File metadata and controls
61 lines (56 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { getDataFromPlainText } from '../split-button/adaptor';
const plainData = 'Edit Document\n\tUndo\n\tRedo\n\tCut\n\tCopy\n\tPaste';
const { label, children, selectedKeys } = getDataFromPlainText(plainData);
const splitButtonProps = {
prefix: 'next-',
type: 'normal',
size: 'medium',
label: label,
defaultSelectedKeys: [],
autoWidth: true,
popupTriggerType: 'click',
plainData,
};
if (selectedKeys && selectedKeys.length) {
splitButtonProps.selectedKeys = selectedKeys;
}
const menuButtonProps = splitButtonProps;
const snippets = [
{
title: '按钮',
screenshot:
'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_button.png',
schema: {
componentName: 'Button',
props: {
prefix: 'next-',
type: 'normal',
size: 'medium',
htmlType: 'button',
component: 'button',
children: '取消',
},
},
},
{
title: '分隔按钮',
screenshot:
'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_split-button.png',
schema: {
componentName: 'SplitButton',
props: splitButtonProps,
children,
},
},
{
title: '菜单按钮',
screenshot:
'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_menu-button.png',
schema: {
componentName: 'MenuButton',
props: menuButtonProps,
children,
},
},
];
export default snippets;