v-for

v-for

  • Expects: Array | Object | Number | String

  • Param Attributes:

  • Usage:

    Render the element or template block multiple times based on the source data. The directive’s value must use the special syntax alias (in|of) expression to provide an alias for the current element being iterated on:

    <div v-for="item in items">
      {{ item.text }}
    </div>

    Note using of as the delimiter is only supported in 1.0.17+.

    Alternatively, you can also specify an alias for the index (or the key if used on an Object):

    <div v-for="(index, item) in items"></div>
    <div v-for="(key, val) in object"></div>

    The detailed usage for v-for is explained in the guide section linked below.

  • See also: List Rendering.

doc_VueJS
2016-09-25 05:48:15
Comments
Leave a Comment

Please login to continue.