mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
支持渲染 button 内容
This commit is contained in:
parent
0bcffe9c51
commit
f2110d5f73
@ -962,7 +962,12 @@
|
||||
"propType": "object",
|
||||
"description": "自定义内联样式"
|
||||
}
|
||||
]
|
||||
],
|
||||
"configure": {
|
||||
"component": {
|
||||
"isContainer": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"componentName": "Button.Group",
|
||||
@ -12355,9 +12360,9 @@
|
||||
"type": "normal",
|
||||
"size": "medium",
|
||||
"htmlType": "button",
|
||||
"component": "button",
|
||||
"children": [ ]
|
||||
}
|
||||
"component": "button"
|
||||
},
|
||||
"children": "取消"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -12370,7 +12375,8 @@
|
||||
"size": "large",
|
||||
"htmlType": "button",
|
||||
"component": "button"
|
||||
}
|
||||
},
|
||||
"children": "提交"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@ -112,7 +112,15 @@
|
||||
},
|
||||
"htmlType": "submit"
|
||||
},
|
||||
"children": "提交"
|
||||
"children": [
|
||||
{
|
||||
"componentName": "Icon",
|
||||
"props": {
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
"提交"
|
||||
]
|
||||
}, {
|
||||
"componentName": "Button",
|
||||
"props": {
|
||||
|
||||
@ -310,7 +310,7 @@ export default class BaseEngine extends PureComponent {
|
||||
...componentInfo,
|
||||
props: transformArrayToMap(componentInfo.props, 'name'),
|
||||
},
|
||||
});
|
||||
}) || {};
|
||||
// 对于可以获取到ref的组件做特殊处理
|
||||
if (acceptsRef(Comp)) {
|
||||
otherProps.ref = (ref) => {
|
||||
|
||||
2
packages/react-renderer/src/utils/index.js
vendored
2
packages/react-renderer/src/utils/index.js
vendored
@ -63,6 +63,8 @@ const ENV = {
|
||||
*/
|
||||
export function isSchema(schema, ignoreArr) {
|
||||
if (isEmpty(schema)) return false;
|
||||
// Leaf 组件也返回 true
|
||||
if (schema.componentName === 'Leaf') return true;
|
||||
if (!ignoreArr && Array.isArray(schema)) return schema.every((item) => isSchema(item));
|
||||
return !!(schema.componentName && schema.props && (typeof schema.props === 'object' || isJSExpression(schema.props)));
|
||||
}
|
||||
|
||||
@ -128,11 +128,10 @@ class Renderer extends Component<{ renderer: SimulatorRenderer }> {
|
||||
});
|
||||
console.info('menuprops', viewProps);
|
||||
}
|
||||
|
||||
return createElement(
|
||||
getDeviceView(Component, device, designMode),
|
||||
viewProps,
|
||||
leaf?.isContainer() ? (children == null ? [] : Array.isArray(children) ? children : [children]) : null,
|
||||
leaf?.isContainer() ? (children == null ? [] : Array.isArray(children) ? children : [children]) : children,
|
||||
);
|
||||
}}
|
||||
onCompGetRef={(schema: any, ref: ReactInstance | null) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user