@ywfe/materials-design
Version:
YwDesign for lowcode
97 lines (94 loc) • 2.29 kB
text/typescript
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
import { TableBaseProps } from '../_base';
const YwTableMeta: IPublicTypeComponentMetadata = {
componentName: 'YwTable',
title: 'YwTable',
docUrl: '',
screenshot: '',
devMode: 'proCode',
group: '基础组件',
category: '基础元素',
npm: {
package: '@ywfe/materials-design',
version: '0.1.0',
exportName: 'YwTable',
main: 'src/index.tsx',
destructuring: true,
subName: '',
},
configure: {
component: {
nestingRule: {
childWhitelist: new RegExp('Table*', 'i'),
},
},
props: TableBaseProps,
supports: {
style: true,
loop: false,
},
},
};
const snippets: IPublicTypeSnippet[] = [
{
title: '通用表格',
screenshot: 'https://yw-fed-static.oss-cn-hangzhou.aliyuncs.com/lowcode/basictable',
schema: {
componentName: 'YwTable',
props: {
dataSource: [
{
id: 1,
itemName: '测试商品1',
cate: '服饰箱包/女装',
price: '线上佣金:15.00%',
tag: '已上架',
status: '成功',
},
{
id: 2,
itemName: '测试商品2',
cate: '服饰箱包/女装',
price: '线上佣金:15.00%',
tag: '待上架',
status: '失败',
},
{
id: 3,
itemName: '测试商品3',
cate: '服饰箱包/女装',
price: '15.00%',
tag: '待上架',
status: '测试1',
},
{
id: 4,
itemName: '测试商品4',
cate: '服饰箱包/女装',
price: '15.00%',
tag: '已上架',
status: '测试1',
},
],
columns: [
{ title: '序号', dataIndex: 'id', component: 'IndexCol', width: 80 },
{
title: '姓名',
dataIndex: 'name',
key: 'name',
},
{
title: '年龄',
dataIndex: 'age',
key: 'age',
},
],
rowKey: 'id',
},
},
},
];
export default {
...YwTableMeta,
snippets,
};