feat: 新增数据源
This commit is contained in:
@@ -20,6 +20,7 @@ export default [
|
||||
{
|
||||
name: 'text',
|
||||
text: '文本',
|
||||
type: 'data-source-input',
|
||||
},
|
||||
{
|
||||
name: 'multiple',
|
||||
|
||||
@@ -24,5 +24,6 @@ export default [
|
||||
{
|
||||
text: '链接',
|
||||
name: 'url',
|
||||
type: 'data-source-input',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -20,5 +20,6 @@ export default [
|
||||
{
|
||||
text: '链接',
|
||||
name: 'url',
|
||||
type: 'data-source-input',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@ export default [
|
||||
{
|
||||
name: 'text',
|
||||
text: '文本',
|
||||
type: 'data-source-input',
|
||||
},
|
||||
{
|
||||
name: 'multiple',
|
||||
|
||||
Reference in New Issue
Block a user