问题:vue父组件向子组件传输数据报错

在学习vue过程中,在父组件向子组件传输数据时报了这个错
[Vue warn]: Missing required prop: “xxx“ found in ---> <Cpn> <Root>
报错的信息大致是:缺失必要的属性“xxxxx”

源码

[Vue warn]: Missing required prop: “xxx“ found in ---> <Cpn> <Root>
[Vue warn]: Missing required prop: “xxx“ found in ---> <Cpn> <Root>
当required设置为true时,这个属性就必须传值,但是我上面的代码已经传了还是报错

解决

两个绑在一个标签内就可以了
[Vue warn]: Missing required prop: “xxx“ found in ---> <Cpn> <Root>
没有报错了
[Vue warn]: Missing required prop: “xxx“ found in ---> <Cpn> <Root>
个人总结:有多个属性绑定时绑到一个标签内
新手上路,学习过程中碰到问题写出来加深印象,如有说错的地方还请大神指出,多多包涵

相关文章:

  • 2022-02-04
  • 2018-09-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-10-01
  • 2021-12-22
猜你喜欢
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
相关资源
相似解决方案