1
0
mirror of synced 2026-03-26 05:18:34 +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

@@ -16,7 +16,7 @@
* limitations under the License.
*/
import React from 'react';
import React, { useRef } from 'react';
import { MComponent } from '@tmagic/schema';
@@ -27,7 +27,7 @@ interface ButtonProps {
}
const Page: React.FC<ButtonProps> = ({ config }) => {
const { app, ref } = useApp({ config });
const { app } = useApp({ config });
if (!app) return null;
@@ -35,10 +35,9 @@ const Page: React.FC<ButtonProps> = ({ config }) => {
return (
<button
ref={ref}
className="magic-ui-button"
style={app.transformStyle(config.style || {})}
id={config.id as string}
id={`${config.id || ''}`}
>
<MagicUiText
config={{
@@ -49,6 +48,6 @@ const Page: React.FC<ButtonProps> = ({ config }) => {
);
};
Page.displayName = 'maigc-ui-button';
Page.displayName = 'magic-ui-button';
export default Page;

View File

@@ -16,4 +16,14 @@
* limitations under the License.
*/
export default [];
export default [
{
name: 'text',
text: '文本',
},
{
name: 'multiple',
text: '多行文本',
type: 'switch',
},
];