Search code examples
vuejs2v-for

Condition in v-for of vue.js?


I would like to avoid image value in below code.image is a key for property. How can I do that ?

<tbody>
    <tr v-for="obj in data" :id="obj.id">
       <td v-for="property in obj">{{property}}</td>
    </tr>
</tbody>

Solution

  • Let check it out: v-for with an Object, v-for with v-if.

    <td v-for="(value, property) in obj" v-if="property!='image'">
        {{value}}
    </td>