mostafalaravel
7 months ago
15
3
Vue

how to use v-if inside v-for

Posted 7 months ago by mostafalaravel

hello ,

I would like to check if the item key inside the v-for contains the term 'date' then to apply date filter on the value.

            <tr v-for="(item,index,i) in actionDetails">
                <td class="p-1 w-px border-t border-grey-light font-mono text-xs text-purple-dark whitespace-no-wrap">{{actionRowsLabels[i]}}</td>
                <td class="p-1 border-t border-grey-light font-mono text-xs text-blue-dark whitespace-pre">{{item}}</td>
            </tr>

something like: if the index value is "startdate" I will make a filter "| moment('DD/MM/YYYY') ..."

thanks

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