Skip to content

Commit

Permalink
fix(okam-core): fix ant page onload data reference problem
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhy committed Nov 8, 2018
1 parent aa885e8 commit 25b8eab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/okam-core/src/extend/data/observable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ export default {
this.__executeDataUpdate = this.$executeDataUpdate.bind(this);

this.$dataListener = new EventListener();
if (this.$rawComputed) {
// fix ant reference bug: `this.data.xx` operation is not allowed
// when page onload, otherwise it'll affect the init data state
// of the page when load next time.
// So, here create a shadow copy of data.
this.data = Object.assign({}, this.data);
}

this.__propsObserver = makePropsObservable(this);
this.__dataObserver = makeDataObservable(this);

Expand Down

0 comments on commit 25b8eab

Please sign in to comment.