diff --git a/packages/form-render-mobile/CHANGELOG.md b/packages/form-render-mobile/CHANGELOG.md index 1bde5199b..117e71780 100644 --- a/packages/form-render-mobile/CHANGELOG.md +++ b/packages/form-render-mobile/CHANGELOG.md @@ -1,5 +1,8 @@ # 更新日志 +### 1.0.14 +- [+] labelWidget、descWidget 增加 addons 访问属性 +- [-] 兼容 widget 大小写配置 ### 1.0.13 - [+] 增加输入控件单独配置布局 layout = 'row' | 'column' - [+] 补齐 tooltip 字段,与 PC 端保持一致 diff --git a/packages/form-render-mobile/package.json b/packages/form-render-mobile/package.json index 122295032..46881d73f 100644 --- a/packages/form-render-mobile/package.json +++ b/packages/form-render-mobile/package.json @@ -1,6 +1,6 @@ { "name": "form-render-mobile", - "version": "1.0.13", + "version": "1.0.14", "description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成", "keywords": [ "Form", diff --git a/packages/form-render-mobile/src/render-core/FieldItem/main.tsx b/packages/form-render-mobile/src/render-core/FieldItem/main.tsx index ed78919c4..87d2cb44a 100644 --- a/packages/form-render-mobile/src/render-core/FieldItem/main.tsx +++ b/packages/form-render-mobile/src/render-core/FieldItem/main.tsx @@ -18,7 +18,9 @@ import { const UpperContext: any = createContext(() => {}); const valuePropNameMap = { checkbox: 'checked', - switch: 'checked' + switch: 'checked', + Checkbox: 'checked', + Switch: 'checked' }; export default (props: any) => { @@ -100,7 +102,7 @@ export default (props: any) => { } // Render field components - let label = getLabel(schema, displayType, widgets); + let label = getLabel(schema, displayType, widgets, fieldProps.addons); let noStyle = getValueFromKey('noStyle'); const extra = getExtraView('extra', schema, widgets); diff --git a/packages/form-render-mobile/src/render-core/FieldItem/module.tsx b/packages/form-render-mobile/src/render-core/FieldItem/module.tsx index 940e9fd99..1ec99769c 100644 --- a/packages/form-render-mobile/src/render-core/FieldItem/module.tsx +++ b/packages/form-render-mobile/src/render-core/FieldItem/module.tsx @@ -65,13 +65,13 @@ export const getPath = (path: any) => { return path; }; -export const getLabel = (schema: any, displayType: string, widgets: any) => { +export const getLabel = (schema: any, displayType: string, widgets: any, addons: any) => { const { title, description, descWidget, labelWidget } = schema; const LabelNode = widgets[labelWidget]; if (LabelNode) { - return + return } if ((!description && !descWidget)) { @@ -81,7 +81,7 @@ export const getLabel = (schema: any, displayType: string, widgets: any) => { const RenderDesc = () => { const Widget = widgets[descWidget]; if (Widget) { - return ; + return ; } if (description) { diff --git a/packages/form-render/CHANGELOG.md b/packages/form-render/CHANGELOG.md index 17462c834..236f39793 100644 --- a/packages/form-render/CHANGELOG.md +++ b/packages/form-render/CHANGELOG.md @@ -1,5 +1,8 @@ # 更新日志 +### 2.3.5 +- [+] labelWidget、descWidget 增加 addons 访问属性 +- [-] 兼容 widget 大小写配置 ### 2.3.0 - [+] 优化 search-form 折叠收起逻辑,不再判断 dom 真实渲染高度,提升渲染性能 - [!] form.getValues 判断 removeHiddenData = true 时,才去除隐藏控件数据 diff --git a/packages/form-render/package.json b/packages/form-render/package.json index 279d1d334..966c898e7 100644 --- a/packages/form-render/package.json +++ b/packages/form-render/package.json @@ -1,6 +1,6 @@ { "name": "form-render", - "version": "2.3.4", + "version": "2.3.5", "description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成", "keywords": [ "Form",