为什么能监听到数组里面某个元素的属性变化 #8151
Replies: 2 comments 5 replies
-
以上 |
Beta Was this translation helpful? Give feedback.
5 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
无子组件:
https://codepen.io/seafronthu/pen/NWOpEvW?editors=1111
vue版本:vue@2.6.0或2.7
点击【点我】按钮结果变成10了,为什么能监听到属性的变化.
有子组件:
https://codepen.io/seafronthu/pen/xxyqQMz?editors=1111
vue版本:vue@2.6.0或2.7
点击【点我】按钮结果变成2了,为什么props中的item没有改变(watch没有触发)也能监听到属性a的变化.
有子组件(setup):
https://codepen.io/seafronthu/pen/oNaZQKm?editors=1111
vue版本:vue@2.7
在setup中使用watch(触发了)反而能监听到item的变化,实际上我没有更新item
以上跟预期的不符
Beta Was this translation helpful? Give feedback.
All reactions