mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 20:39:07 +08:00
form init 过程中不要去 diff 参数变化发送请求
This commit is contained in:
parent
8a34b0d420
commit
53314a4f89
@ -58,7 +58,7 @@ export default class ChainedSelectControl extends React.Component<
|
||||
componentDidUpdate(prevProps: ChainedSelectProps) {
|
||||
const props = this.props;
|
||||
|
||||
if (props.value !== prevProps.value) {
|
||||
if (props.formInited && props.value !== prevProps.value) {
|
||||
this.loadMore();
|
||||
}
|
||||
}
|
||||
|
@ -86,8 +86,8 @@ export default class MatrixCheckbox extends React.Component<
|
||||
rows: nextProps.rows || []
|
||||
});
|
||||
} else if (
|
||||
nextProps.source !== props.source ||
|
||||
props.data !== nextProps.data
|
||||
nextProps.formInited &&
|
||||
(nextProps.source !== props.source || props.data !== nextProps.data)
|
||||
) {
|
||||
let prevApi = buildApi(props.source as string, props.data as object, {
|
||||
ignoreData: true
|
||||
|
@ -3,7 +3,7 @@
|
||||
* List、ButtonGroup 等等
|
||||
*/
|
||||
import {Api, Schema} from '../../types';
|
||||
import {isEffectiveApi, isApiOutdated} from '../../utils/api';
|
||||
import {isEffectiveApi, isApiOutdated, isValidApi} from '../../utils/api';
|
||||
import {isAlive} from 'mobx-state-tree';
|
||||
import {
|
||||
anyChanged,
|
||||
@ -210,7 +210,7 @@ export function registerOptionsControl(config: OptionsConfig) {
|
||||
const props = this.props;
|
||||
const formItem = props.formItem as IFormItemStore;
|
||||
|
||||
if (!formItem) {
|
||||
if (!formItem || !props.formInited) {
|
||||
return;
|
||||
} else if (!prevProps.formItem) {
|
||||
// todo 优化 name 变化情况。
|
||||
@ -242,6 +242,7 @@ export function registerOptionsControl(config: OptionsConfig) {
|
||||
prevOptions !== options &&
|
||||
formItem.setOptions(normalizeOptions(options || []));
|
||||
} else if (
|
||||
isEffectiveApi(props.source, props.data) &&
|
||||
isApiOutdated(
|
||||
prevProps.source,
|
||||
props.source,
|
||||
|
Loading…
Reference in New Issue
Block a user