mostafalaravel
8 months ago
12
1
Vue

change the object attribute value in v-for loop .

Posted 8 months ago by mostafalaravel

Hello,

here the template :

            <tr>

                <td colspan="16">
                    <div class="px-3 py-2">
                        <span  v-for="(val,key) in actionFilterContent" v-if="val !== null" v-on:click="val = null"><span class="text-xs text-green-darkest">{{val}}</span> </span>
                    </div>
                </td>

            </tr>

actionFilterContent :

actionFilterContent : {
                    "group": null,
                    "status": null,
                    "action_name": null,
                    "action_number": null,
                    "action_po_box": null,
                    "nofab_description": null,
                    "brand": null,
                    "action_description_nl": null,
                    "action_description_fr": null,
                    "action_description_en": null,
                    "action_type": null,
                    "is_cashback": null,
                    "is_expedition": null,
                    "startdate": null,
                    "enddate": null,
                    "extentiondate": null
                },

Question is : how to when I click on the span tag I change actionFilterContent to null ?

thanks

Please sign in or create an account to participate in this conversation.