Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
613 views
in Technique[技术] by (71.8m points)

vue.js中子父级双向绑定报错的原因?

图片描述

这是我的代码过程,虽然已经实现了双向绑定,但是当通过子组件改变数据时,浏览器就会报错。
图片描述


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

1 Answer

0 votes
by (71.8m points)

v-model='nozzle'是不对的,在子组件里你不要试图改变传入的属性值。
子组件的属性值是只读的。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...