mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
amis-saas-8684 mapping editor 增加 map类型变动监听
Change-Id: Ie6bad448b43cde8f3b6627e4f3bb970ff627e571
This commit is contained in:
parent
08dc068e0e
commit
d6054ea62b
@ -50,6 +50,17 @@ export default class MapSourceControl extends React.Component<
|
||||
};
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: Readonly<MapSourceControlProps>, prevState: Readonly<MapSourceControlState>, snapshot?: any): void {
|
||||
const isArrayOld = Array.isArray(prevProps.data?.map);
|
||||
const isArrayNew = Array.isArray(this.props.data?.map);
|
||||
// map 类型改变了
|
||||
if (isArrayOld !== isArrayNew) {
|
||||
this.setState({
|
||||
map: this.props.data?.map
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新map字段的统一出口
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user