mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 10:59:42 +08:00
还原cachedValue
This commit is contained in:
parent
ac18ca98d7
commit
8049b439ba
@ -92,7 +92,7 @@ export class ContextMenu extends React.Component<
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
document.body.addEventListener('click', this.handleOutClick);
|
||||
document.body.addEventListener('click', this.handleOutClick, true);
|
||||
document.addEventListener('keydown', this.handleKeyDown);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
|
||||
if (!isObject(value)) {
|
||||
return [];
|
||||
}
|
||||
if (isEqual(value, this?.cachedValue)) {
|
||||
if (isEqual(value, this.cachedValue)) {
|
||||
return this.cachedValueArray;
|
||||
}
|
||||
const arr: Array<any> = [];
|
||||
@ -56,8 +56,8 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
|
||||
|
||||
obj[key] = value;
|
||||
});
|
||||
this && (this.cachedValue = obj);
|
||||
this && (this.cachedValueArray = value);
|
||||
this.cachedValue = obj;
|
||||
this.cachedValueArray = value;
|
||||
return obj;
|
||||
},
|
||||
items: [
|
||||
|
Loading…
Reference in New Issue
Block a user