mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
buttonGroup 数据同步问题
This commit is contained in:
parent
f624448dde
commit
78879d5266
@ -137,7 +137,8 @@ export default class ButtonGroupControl extends React.Component<
|
||||
|
||||
@OptionsControl({
|
||||
type: 'button-group',
|
||||
sizeMutable: false
|
||||
sizeMutable: false,
|
||||
strictMode: false
|
||||
})
|
||||
export class ButtonGroupControlRenderer extends ButtonGroupControl {
|
||||
render() {
|
||||
|
@ -15,7 +15,8 @@ import {
|
||||
isObject,
|
||||
isVisible,
|
||||
createObject,
|
||||
extendObject
|
||||
extendObject,
|
||||
cloneObject
|
||||
} from '../../utils/helper';
|
||||
import debouce = require('lodash/debounce');
|
||||
import flatten = require('lodash/flatten');
|
||||
@ -323,13 +324,13 @@ export default class Form extends React.Component<FormProps, object> {
|
||||
// 先拿出来数据,主要担心 form 被什么东西篡改了,然后又应用出去了
|
||||
// 之前遇到过问题,所以拿出来了。但是 options loadOptions 默认值失效了。
|
||||
// 所以目前需要两个都要设置一下,再 init Hook 里面。
|
||||
const data = {...store.data};
|
||||
const data = cloneObject(store.data);
|
||||
|
||||
store.setInited(true);
|
||||
const hooks: Array<(data: any) => Promise<any>> = this.hooks['init'] || [];
|
||||
await Promise.all(hooks.map(hook => hook(data)));
|
||||
|
||||
onInit && onInit(extendObject(store.data, data), this.props);
|
||||
onInit && onInit(data, this.props);
|
||||
|
||||
submitOnInit &&
|
||||
this.handleAction(
|
||||
|
Loading…
Reference in New Issue
Block a user