如果我们 vue 组件中 template 里面添加了下标(靠数组索引得到的值),就会报索引为 undefined

  解决方法:

    Error in render: "TypeError: Cannot read property 'url_img' of undefined"

  在我们使用下标时,要在父组件上做条件判断,如果这个下标存在,然后就显示里面的内容,这样就不会报 undefined 了,

相关文章:

  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-05-24
  • 2021-08-06
  • 2021-07-10
  • 2022-12-23
猜你喜欢
  • 2022-01-16
  • 2021-05-21
  • 2021-12-03
  • 2021-09-06
  • 2021-05-05
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案