manifest.json
1.组件manifest.json
分类 | 字段 | 类型 | 描述 |
---|
基本信息 | code | string | 编码(英文) |
| name | string | 名称(中文) |
| version | string | 版本号 |
| domainKey | string | 领域编码 |
| keyword | string | 关键字 |
| description | string | 组件包描述 |
组件信息 | components | Array | 组件包结构描述 |
分组信息 | group | Array | 分组结构描述 |
"code": "bip_component_web",
"name": "bip_component_web",
"version": "1.0.0",
"domainKey": "developplatform", // domainKey
"keyword": "bip_component_web library",
"description": "bip_component_web组件包",
"terminalType": 1,
"components": [
// ...
],
"group": [
// ...
],
1.1.components
分类 | 字段 | 类型 | 描述 |
---|
基本信息 | code | string | 编码(英文) |
| name | string | 名称(中文) |
| type | string | 组件分类类型,TypeProps |
| description | string | 组件描述 |
| uiExtClass | string | 组件类型,UIExtClass |
| compType | string | 跟字段【uiExtClass】同值 |
| libraryGroupId | string | 分组ID |
属性信息 | props | Array | 属性结构描述 |
事件信息 | events | Array | 事件结构描述 |
export enum UIExtClass {
Container = 'xcontainer', // 容器
Control = 'xcontrol', // 控件
Button = 'xbutton' //按钮
}
export enum TypeProps {
LayoutContainer = 'layoutContainer',
DataContainer = 'dataContainer',
BasicControls = 'basicControls',
FormControls = 'formControls',
FunctionalControls = 'functionalControls',
BusinessControls = 'businessControls',
InterfaceControls = 'interfaceControls'
}
{
name: "按钮",
code: "BipButton",
icon: "lowcode lcButton",
type: "basicControls",
uiExtClass: "xbutton",
compType: "xbutton",
libraryGroupId: "baseGroup",
props: [
// ...
],
events: [
// ...
],
children: [
// ...
]
}
1.1.1.props
分类 | 字段 | 类型 | 描述 |
---|
基本信息 | code | string | 编码(英文) |
| name | string | 名称(中文) |
| type | string | 字段值类型,FieldTypes |
| description | string | 属性描述 |
| defaultValue | 跟随type字段值类型 | 默认值 |
| showDesign | string | 设计态显示与否 |
meta信息 | metaType | Array | meta类型 |
| metaProps | Array | meta属性 |
export enum FieldTypes {
string = 'string',
number = 'number',
boolean = 'boolean',
object = 'object',
date = 'date',
action = 'action',
child = 'child',
array = 'array'
}
props: [
{
name: "按钮大小",
code: "size",
type: FieldTypes.string,
defaultValue: "lg",
metaType: EditTypes.Select,
metaProps: JSON.stringify({
options: [
{ value: "lg", text: "大号按钮" },
{ value: "md", text: "中号按钮" },
{ value: "sm", text: "小号按钮" }
]
}),
showDesign: true
}
]
1.1.2.events
分类 | 字段 | 类型 | 描述 |
---|
基本信息 | operationCode | string | 编码(英文) |
| operationName | string | 名称(中文) |
| description | string | 事件描述 |
关联信息 | metaType | Array | 关联组件Code |
| metaProps | Array | 数组【组件Code】 |
events: [{
uiDefineId: "BipButton",
operationCode: "onClick",
operationName: "点击",
uitypes: ["BipButton"]
}]
1.1.3.children
1.2.group
分类 | 字段 | 类型 | 描述 |
---|
基本信息 | id | string | 编码(英文) |
| name | string | 名称(中文) |
| description | string | 分组描述 |
| children | Array | 子集,数组【组件Code】 |
"group": [
{
"id": "baseContainer",
"name": "基础容器",
"children": [
"BipButton"
]
}
]
2.函数manifest.json
分类 | 字段 | 类型 | 描述 |
---|
基本信息 | code | string | 编码(英文) |
| name | string | 名称(中文) |
| keyword | string | 关键字 |
| domainKey | string | 领域编码 |
| description | string | 函数包描述 |
| terminalType | Array | 终端类型 |
[
"PC", "Mobile", "WX", "DD"
]
{
"name": "bip_api",
"version": "1.0.0",
"keyword": "bip_api library",
"code": "bip_api",
"description": "bip_api函数包",
"terminalType": [
"PC",
"Mobile",
"WX",
"DD"
]
}
3.如何从yon-ui-cli升级manifest.json
3.1.废除字段
- 设计态描述字段【component.props.designConfig】
- 描述相关字段【mdDescription|des】等,统一命名【description】;
3.2.设计态描述变更【component.props.designConfig】
// before:
designConfig: {
type: EditTypes.Select,
props: {
options: [
{ value: 'lg', text: '大号按钮' },
{ value: 'md', text: '中号按钮' },
{ value: 'sm', text: '小号按钮' }
]
}
}
// after:
metaType: EditTypes.Select,
metaProps: JSON.stringify({
options: [
{ value: "lg", text: "大号按钮" },
{ value: "md", text: "中号按钮" },
{ value: "sm", text: "小号按钮" }
]
})
3.3.事件描述变更【component.events】
// before:
{
code: 'onClick',
name: '点击'
}
// after:
events: [{
uiDefineId: "componentID",
operationCode: "onClick",
operationName: "点击",
uitypes: ["componentID"]
}]
3.4.必填属性【component.(uiExtClass|compType)】
uiExtClass: UIExtClass.Button,
compType: UIExtClass.Button,