update doc
This commit is contained in:
@@ -45,7 +45,6 @@ const MButton = new ComponentItemFactory(
|
|||||||
createPannelOptions<FormMap, 'input'>('input', {
|
createPannelOptions<FormMap, 'input'>('input', {
|
||||||
receive: 'text',
|
receive: 'text',
|
||||||
label: '文字',
|
label: '文字',
|
||||||
text: 'yehuozhili',
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
animate: [createPannelOptions<FormMap, 'animateControl'>('animateControl', {})],
|
animate: [createPannelOptions<FormMap, 'animateControl'>('animateControl', {})],
|
||||||
@@ -54,6 +53,7 @@ const MButton = new ComponentItemFactory(
|
|||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
...
|
...
|
||||||
|
text:'yehuozhili'// input配置项组件接收的初始值
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
(data, context, store, config) => {
|
(data, context, store, config) => {
|
||||||
|
@@ -22,7 +22,6 @@ export interface FormBaseType {
|
|||||||
}
|
}
|
||||||
export interface FormInputType extends FormBaseType {
|
export interface FormInputType extends FormBaseType {
|
||||||
label: string;
|
label: string;
|
||||||
text: string;
|
|
||||||
}
|
}
|
||||||
export interface FormActionButtonType {}
|
export interface FormActionButtonType {}
|
||||||
export interface FormAnimateControlType {}
|
export interface FormAnimateControlType {}
|
||||||
@@ -34,7 +33,7 @@ export interface FormMap {
|
|||||||
```
|
```
|
||||||
formMap的键名就是initFormComponents键名,formMap的值对应组件需要收到的值。
|
formMap的键名就是initFormComponents键名,formMap的值对应组件需要收到的值。
|
||||||
|
|
||||||
以input组件为例,FormInputType此时有3个属性,label,text,receive。
|
以input组件为例,FormInputType此时有2个属性,label,receive。
|
||||||
|
|
||||||
那么在其开发该组件时,props会收到:
|
那么在其开发该组件时,props会收到:
|
||||||
|
|
||||||
@@ -55,7 +54,6 @@ style: [
|
|||||||
createPannelOptions<FormMap, 'input'>('input', {
|
createPannelOptions<FormMap, 'input'>('input', {
|
||||||
receive: 'text',
|
receive: 'text',
|
||||||
label: '文字',
|
label: '文字',
|
||||||
text: 'yehuozhili',
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* @Author: yehuozhili
|
* @Author: yehuozhili
|
||||||
* @Date: 2021-07-07 14:32:55
|
* @Date: 2021-07-07 14:32:55
|
||||||
* @LastEditors: yehuozhili
|
* @LastEditors: yehuozhili
|
||||||
* @LastEditTime: 2021-07-13 15:07:08
|
* @LastEditTime: 2021-08-05 15:27:21
|
||||||
* @FilePath: \dooringx\packages\dooringx-example\src\plugin\formComponents\input.tsx
|
* @FilePath: \dooringx\packages\dooringx-example\src\plugin\formComponents\input.tsx
|
||||||
*/
|
*/
|
||||||
import { deepCopy, UserConfig } from 'dooringx-lib';
|
import { deepCopy, UserConfig } from 'dooringx-lib';
|
||||||
@@ -21,17 +21,17 @@ interface MInputProps {
|
|||||||
|
|
||||||
function MInput(props: MInputProps) {
|
function MInput(props: MInputProps) {
|
||||||
const option = useMemo(() => {
|
const option = useMemo(() => {
|
||||||
return props.data?.option || {};
|
return props.data.option || {};
|
||||||
}, [props.data]);
|
}, [props.data]);
|
||||||
const store = props.config.getStore();
|
const store = props.config.getStore();
|
||||||
return (
|
return (
|
||||||
<Row style={{ padding: '10px 20px' }}>
|
<Row style={{ padding: '10px 20px' }}>
|
||||||
<Col span={6} style={{ lineHeight: '30px' }}>
|
<Col span={6} style={{ lineHeight: '30px' }}>
|
||||||
{(option as any)?.label || '文字'}:
|
{option.label || '文字'}:
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={18}>
|
<Col span={18}>
|
||||||
<Input
|
<Input
|
||||||
value={props.current.props[(option as any).receive] || ''}
|
value={props.current.props[option.receive!] || ''}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const receive = (option as any).receive;
|
const receive = (option as any).receive;
|
||||||
const clonedata = deepCopy(store.getData());
|
const clonedata = deepCopy(store.getData());
|
||||||
|
Reference in New Issue
Block a user