vue报错:Type of the default value for data prop must be a function

刺骨的言语ヽ痛彻心扉 2023-02-25 02:25 137阅读 0赞

出现情况:

  1. props: {
  2. propsA: {
  3. type: Object,
  4. default: { }
  5. }
  6. }

解决方法:

  1. props: {
  2. propsA: {
  3. type: Object,
  4. default: _ => {
  5. return {
  6. id: '',
  7. name: ''
  8. }
  9. }
  10. }
  11. }

发表评论

表情:
评论列表 (有 0 条评论,137人围观)

还没有评论,来说两句吧...

相关阅读