Skip to content

Commit

Permalink
feat: add breadcrumb meta
Browse files Browse the repository at this point in the history
  • Loading branch information
linqiqi077 committed Jan 10, 2024
1 parent 1cf0b2d commit 4151d11
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 1 deletion.
112 changes: 112 additions & 0 deletions packages/yunti-ui-lowcode-materials/lowcode/breadcrumb/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

import { getMeta } from '../utils';

const BreadcrumbMeta: IPublicTypeComponentMetadata = getMeta('Breadcrumb', {
title: '面包屑',
group: '组件',
category: '基础组件',

configure: {
props: [
{
name: 'items',
title: '列表项',
setter: {
componentName: 'ArraySetter',
props: {
itemSetter: {
componentName: 'ObjectSetter',
props: {
config: {
items: [
{
name: 'title',
title: '标题',
initialValue: 'Home',
propType: {
type: 'oneOfType',
value: ['node', 'string'],
},
setter: ['StringSetter', 'SlotSetter', 'VariableSetter', 'I18nSetter'],
},
{
name: 'href',
title: '跳转',
initialValue: '/',
propType: {
type: 'oneOfType',
value: ['string'],
},
setter: ['StringSetter', 'VariableSetter'],
},
],
},
},
},
},
},
},
{
name: 'separator',
title: {
label: '分隔符',
tip: '要显示的分隔符',
},
initialValue: '/',
propType: {
type: 'oneOfType',
value: ['node', 'string'],
},
setter: ['StringSetter', 'SlotSetter', 'VariableSetter'],
},
{
name: 'rootClassName',
title: { label: '类名' },
setter: ['StringSetter', 'VariableSetter'],
},
],
component: {
isContainer: true,
},
supports: {
style: true,
loop: true,
condition: true,
events: [],
},
advanced: {},
},
});
const snippets: IPublicTypeSnippet[] = [
{
title: '面包屑',
schema: {
componentName: 'Breadcrumb',
props: {
__component_name: 'Breadcrumb',
items: [
{
title: 'Home',
},
{
title: 'Application Center',
},
{
title: 'Application List',
},
{
title: 'An Application',
},
],
},
},
},
];

const meta = {
...BreadcrumbMeta,
snippets,
};

export default meta;
3 changes: 2 additions & 1 deletion packages/yunti-ui-lowcode-materials/lowcode/meta.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pkgJson from '../package.json';
import breadcrumb from './breadcrumb/meta';
import tree from './tree/meta';

const components = [tree].map(c => {
const components = [tree, breadcrumb].map(c => {
if (c.npm) {
c.npm.version = pkgJson.version;
}
Expand Down

0 comments on commit 4151d11

Please sign in to comment.