Welcome to Qi-U Community for programmer and developer-Open, Learning and Share

Categories

0 votes
232 views
in Technique[技术] by (31.9m points)

vue 父组件修改值以后,子组件不能修改

如图父组件中,修改了hightQuery的值
image.png
然后调用子组件函数(传参是hightQuery),发现立面的值没有修改为空

image.png

子组件中

image.png

打印:
image.png

测试以后发现只有子组件重加载以后才会获得最新的父组件传来的值,想知道有没有办法能随时监听到并渲染的办法吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (31.9m points)

这个有点麻烦,直接使用形参解决就行了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Qi-U Community for programmer and developer-Open, Learning and Share
...