1
0
mirror of synced 2026-04-05 07:48:35 +08:00

feat: 新增蒙层组件

This commit is contained in:
roymondchen
2022-05-27 18:47:29 +08:00
committed by jia000
parent 0397c6887a
commit 44aa56bd52
62 changed files with 1045 additions and 41 deletions

View File

@@ -29,15 +29,14 @@ interface ContainerProps {
id: string;
}
const Container: React.FC<ContainerProps> = ({ config }) => {
const { app, ref } = useApp({ config });
const Container: React.FC<ContainerProps> = ({ config, id }) => {
const { app } = useApp({ config });
if (!app) return null;
return (
<div
ref={ref}
id={`${config.id}`}
id={`${id || config.id || ''}`}
className={`magic-ui-container${config.className ? ` ${config.className}` : ''}`}
style={app.transformStyle(config.style || {})}
>
@@ -48,7 +47,7 @@ const Container: React.FC<ContainerProps> = ({ config }) => {
return (
<MagicUiComp
id={`${item.id}`}
id={`${item.id || ''}`}
key={item.id}
config={item}
className={`magic-ui-component${config.className ? ` ${config.className}` : ''}`}

View File

@@ -16,4 +16,15 @@
* limitations under the License.
*/
export default [];
export default [
{
name: 'layout',
text: '容器布局',
type: 'select',
defaultValue: 'absolute',
options: [
{ value: 'absolute', text: '绝对定位' },
{ value: 'relative', text: '流式布局' },
],
},
];