mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 20:39:07 +08:00
fix: matrixCheckboxes 如果直接 form 外面有可能报错
This commit is contained in:
parent
2e94d3dcf6
commit
5c61baf814
@ -109,9 +109,7 @@ export default class MatrixCheckbox extends React.Component<
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const {formInited, addHook} = this.props;
|
const {formInited, addHook} = this.props;
|
||||||
|
|
||||||
formInited || !addHook
|
formInited || !addHook ? this.reload() : addHook(this.initOptions, 'init');
|
||||||
? this.reload()
|
|
||||||
: addHook?.(this.initOptions, 'init');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps: MatrixProps) {
|
componentDidUpdate(prevProps: MatrixProps) {
|
||||||
@ -146,7 +144,7 @@ export default class MatrixCheckbox extends React.Component<
|
|||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.mounted = false;
|
this.mounted = false;
|
||||||
const {removeHook} = this.props;
|
const {removeHook} = this.props;
|
||||||
removeHook(this.initOptions, 'init');
|
removeHook?.(this.initOptions, 'init');
|
||||||
}
|
}
|
||||||
|
|
||||||
async initOptions(data: any) {
|
async initOptions(data: any) {
|
||||||
|
Loading…
Reference in New Issue
Block a user