Skip to content

Commit

Permalink
omi v4.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
张磊 committed Nov 1, 2018
1 parent 642e245 commit 2d926d8
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 32 deletions.
4 changes: 2 additions & 2 deletions README.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,14 @@ define("my-app", class extends WeElement {
})
```
需要特别注意的是,如果使用了 `observe`,不要在以下函数里设置 data 的值:
需要特别注意的是,如果使用了 `observe`,不要在以下函数里设置 data 的值某些属性为 obj 或 arr等复杂对象:
* render
* beforeRender
* beforeUpdate
* afterUpdate
因为 data 设置会触发 update ,update 会触发上面函数,就无限递归了。
因为 data 设置只会简单对比前后的值,复杂对象不会深对比,对比值不同会触发 update ,update 会触发上面函数,就无限递归了。
如果你想要兼容 IE11,请使用 `omi-mobx` 代替 omi 自带的 observe,往下看..
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,14 @@ define("my-app", class extends WeElement {
})
```
It should be noted that if `observe` is used, do not set the value of data in the following functions:
It should be noted that if `observe` is used, do not set the value of data in some of the following functions: some complex objects such as obj or arr:
* render
* beforeRender
* beforeUpdate
* afterUpdate
Because data setter triggers update, update triggers the above function, and it is infinite recursion.
Because data settings will simply compare the value before and after, complex objects will not be deep contrast, the contrast value will trigger different update, update will trigger the above function, infinite recursion.
If you want to be compatible with IE11, please use the `omi-mobx` instead of omi's own observe.
Expand Down
25 changes: 18 additions & 7 deletions packages/omi/dist/omi.dev.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/omi/dist/omi.dev.js.map

Large diffs are not rendered by default.

25 changes: 18 additions & 7 deletions packages/omi/dist/omi.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/omi/dist/omi.esm.js.map

Large diffs are not rendered by default.

20 changes: 14 additions & 6 deletions packages/omi/dist/omi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/omi/dist/omi.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 2d926d8

Please sign in to comment.