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
358 views
in Technique[技术] by (71.8m points)

vue 子组件直接更改 props 有啥不良后果?

1.props 不同的类型情况,如为数字,字符串,或对象类型,函数类型,直接修改props的不良后果有区别吗?

2.不加 .sync 修饰符,有啥不良后果?


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

1 Answer

0 votes
by (71.8m points)

基本类型你修改也没用。

引用类型倒是可以修改,但是数据流向不清晰


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

...