forked from p96170835/amis
form data 可以通过 __pristine 获取原始值
This commit is contained in:
parent
c0de429521
commit
77e2158540
|
@ -122,7 +122,6 @@ export const FormStore = ServiceStore.named('FormStore')
|
|||
}
|
||||
|
||||
setVariable(data, name, value);
|
||||
self.data = data;
|
||||
|
||||
if (isPristine) {
|
||||
const pristine = cloneObject(self.pristine);
|
||||
|
@ -130,6 +129,17 @@ export const FormStore = ServiceStore.named('FormStore')
|
|||
self.pristine = pristine;
|
||||
}
|
||||
|
||||
if (!data.__pristine) {
|
||||
Object.defineProperty(data, '__pristine', {
|
||||
value: self.pristine,
|
||||
enumerable: false,
|
||||
configurable: false,
|
||||
writable: false
|
||||
});
|
||||
}
|
||||
|
||||
self.data = data;
|
||||
|
||||
if (self.persistData) {
|
||||
setPersistData();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue