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
37 lines (34 loc) · 834 Bytes
/
snippets.design.ts
File metadata and controls
37 lines (34 loc) · 834 Bytes
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
import parseData from '../utils/parse-data';
const plainData = 'Option 1\n*Option 2\nOption 3\nOption 4\nOption 5';
const list = parseData(plainData).filter(({ type }) => 'node' === type);
const dataSource = [];
const value = [];
list.forEach((item, index) => {
dataSource.push({
label: item.value,
value: index,
disabled: item.state === 'disabled',
});
if (item.state === 'active') {
value.push(index);
}
});
export default [
{
title: '选择器',
screenshot:
'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_select.png',
schema: {
componentName: 'Select',
props: {
mode: 'single',
hasArrow: true,
cacheValue: true,
visible: true,
plainData,
dataSource,
value,
},
},
},
];