1
0
mirror of synced 2026-03-24 03:38:34 +08:00

feat: 新增数据源

This commit is contained in:
roymondchen
2023-05-29 11:33:44 +08:00
parent d0ec2fd588
commit aac478eebc
94 changed files with 3601 additions and 765 deletions

View File

@@ -20,6 +20,7 @@ export default [
{
name: 'text',
text: '文本',
type: 'data-source-input',
},
{
name: 'multiple',

View File

@@ -24,5 +24,6 @@ export default [
{
text: '链接',
name: 'url',
type: 'data-source-input',
},
];

View File

@@ -20,5 +20,6 @@ export default [
{
text: '链接',
name: 'url',
type: 'data-source-input',
},
];

View File

@@ -16,7 +16,7 @@
* limitations under the License.
*/
import React, { useState } from 'react';
import React from 'react';
import type { MComponent } from '@tmagic/schema';
@@ -27,15 +27,13 @@ interface TextProps {
}
const Text: React.FC<TextProps> = ({ config }) => {
const { app, ref } = useApp({ config });
const { app } = useApp({ config });
if (!app) return null;
const [displayText] = useState(config.text);
return (
<div ref={ref} className="magic-ui-text" style={app.transformStyle(config.style || {})} id={`${config.id || ''}`}>
{displayText}
<div className="magic-ui-text" style={app.transformStyle(config.style || {})} id={`${config.id || ''}`}>
{config.text}
</div>
);
};

View File

@@ -20,6 +20,7 @@ export default [
{
name: 'text',
text: '文本',
type: 'data-source-input',
},
{
name: 'multiple',