search

Home  >  Q&A  >  body text

javascript - Problems encountered when traversing arrays with Vue's v-for instruction

I traversed like this:

But the browser gave this error:

It says that [index] cannot be found, which is the array index. Why is this?

ringa_leeringa_lee2711 days ago743

reply all(4)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-14 10:56:43

    The span tag should be written inside the li tag

    reply
    0
  • PHP中文网

    PHP中文网2017-06-14 10:56:43

    The variable of v-for can only be used on the child elements of this tag

    reply
    0
  • PHP中文网

    PHP中文网2017-06-14 10:56:43

    Have you read the documentation for vue class binding
    https://cn.vuejs.org/v2/guide...

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-14 10:56:43

    Don’t use seller.supports[index].type in the loop. Just use item.type directly.

    reply
    0
  • Cancelreply