组件原型类型

interface IComponentPrototype {
    category?:
        | "basic"
        | "layout"
        | "condition"
        | "typography"
        | "nav"
        | "form"
        | "xform"
        | "xtable"
        | "input"
        | "display"
        | "feedback"
        | "other"
        | "biz";
    childrenName?: string | string[];
    defaultChildren?: string;
    docs?: string;
    exportType?: "defaultExport" | "namedExport";
    hasChildren?: boolean;
    help?: string;
    icon?: string;
    initChildren?: string;
    name: string;
    package: string;
    props?: IComponentProp<any>[];
    relatedImports?: string[];
    rules?: IComponentDndRules;
    siblingNames?: string[];
    title?: string;
    type:
        | "placeholder"
        | "page"
        | "container"
        | "element"
        | "snippet"
        | "block";
    usage?: string;
}

Properties

category?:
    | "basic"
    | "layout"
    | "condition"
    | "typography"
    | "nav"
    | "form"
    | "xform"
    | "xtable"
    | "input"
    | "display"
    | "feedback"
    | "other"
    | "biz"

分类 basic 通用 layout 布局容器 condition 条件容器 typography 排版 nav 导航 form 表单容器 input 输入 display 展示 feedback 反馈 other 其他 biz 业务扩展

已废弃,可以不提供

childrenName?: string | string[]

直接子节点的类型

defaultChildren?: string

已废弃,请使用 initChildren 替代

docs?: string

物料的文档地址

https://music-one.fn.netease.com/docs/button
exportType?: "defaultExport" | "namedExport"

导出方式

namedExport
import { Button } from 'antd';
import request from 'antd';
hasChildren?: boolean

是否有子元素,决定了组件标签的声明方式

<Button>hello</Button>
<Button />
help?: string

组件说明文档,帮助信息

icon?: string

图标名,或图片地址

icon-tupian,仅支持来自 tango 官方图标库图标名
https://p5.music.126.net/obj/wonDlsKUwrLClGjCm8Kx/11255815437/3e21/463f/8ccc/74dc164beb4cc311a203671c7ac25129.png
initChildren?: string

拖拽初始化的默认子元素

name: string

组件名

Button
package: string

组件所属的包

antd
'./blocks'
props?: IComponentProp<any>[]

组件的可配置属性集

relatedImports?: string[]

关联引入的组件,如果在 initChildren 里声明了,这里需要加上,用户关联导入

组件的拖拽规则

siblingNames?: string[]

兄弟节点的类型

title?: string

组件中文名

按钮
type:
    | "placeholder"
    | "page"
    | "container"
    | "element"
    | "snippet"
    | "block"

类型 page 页面跟节点 container 布局容器 placeholder 占位容器 element 元件或组件 snippet 代码片段 block 区块

usage?: string

用法

import { Button } from 'antd';