@ywfe/materials-design
Version:
YwDesign for lowcode
135 lines (132 loc) • 2.96 kB
text/typescript
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
import { IPublicTypeSnippetMore } from '../_base';
const YwTitleMeta: IPublicTypeComponentMetadata = {
componentName: 'YwTitle',
title: '标题',
docUrl: '',
screenshot: '',
devMode: 'proCode',
group: '基础组件',
category: '展示',
npm: {
package: '@ywfe/materials-design',
version: '0.1.0',
exportName: 'YwTitle',
main: 'src/index.tsx',
destructuring: true,
subName: '',
},
configure: {
props: [
{
title: {
label: '标题',
tip: 'text | 标题',
},
name: 'text',
description: '标题',
setter: {
componentName: 'StringSetter',
isRequired: true,
initialValue: '页面标题',
},
},
{
title: {
label: '副标题',
tip: 'subtitle | 副标题',
},
name: 'subtitle',
description: '副标题',
setter: {
componentName: 'StringSetter',
isRequired: false,
initialValue: '副标题',
},
},
{
title: {
label: '标题尺寸',
tip: 'size | 标题尺寸',
},
name: 'size',
description: '标题尺寸',
setter: {
componentName: 'RadioGroupSetter',
isRequired: true,
props: {
dataSource: [
{
label: 'l',
value: 'l',
},
{
label: 'm',
value: 'm',
},
{
label: 's',
value: 's',
},
],
options: [
{
label: 'l',
value: 'l',
},
{
label: 'm',
value: 'm',
},
{
label: 's',
value: 's',
},
],
},
initialValue: 'm',
},
},
{
title: {
label: '自定义渲染',
tip: 'children | 自定义渲染',
},
name: 'children',
description: '自定义渲染',
setter: {
componentName: 'SlotSetter',
props: {
mode: 'node',
},
isRequired: false,
initialValue: {
type: 'JSSlot',
value: [],
},
},
},
],
supports: {
style: true,
},
component: {
isContainer: false,
},
},
};
const snippets: IPublicTypeSnippetMore[] = [
{
title: '标题',
svgId: 'icon-biaoti',
screenshot: 'https://yw-fed-static.oss-cn-hangzhou.aliyuncs.com/lowcode/pageBigTitle',
schema: {
componentName: 'YwTitle',
props: {},
},
},
];
export default {
...YwTitleMeta,
snippets,
};