-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为什么不增加一个 watch API 呢 #36
Comments
Component properties 可以先用 observe 满足,其他场景确实需要 watch API,欢迎 PR ~ |
@imyelo 我现在在做一个国际化插件,实现过程是:在 Page Componen 函数(或者wx)下增加一个 lang 属性,在每个 page 页面或者是 component 组件下,进行 watch 监听该属性,在变化时,进行更新 data 数据。 |
我现在自己用 Object.defineProperty 手写了个先用 😂 |
Component 现在兼容了 observers 接口 #40 ,对在组件中监听数据的场景有帮助 😄 |
@imyelo 好的谢谢,但是我觉的 Component 组件数据字段监听器,用于监听 properties 和 data 的变化,好像不能对全局变量进行监听比如 app.globaldata wx.[xxx]这样的,还有就是 page 下,希望能考虑支持下。 |
watch 还是有场景需要的说,特意来看看。 |
是否考虑下!
The text was updated successfully, but these errors were encountered: