q-item highlight selected item in V1 when using v-for
-
Can someone guide on how to higlight the selected item when using v-for
Unable to find anything related in docs. active-class works if without v-for
<q-list :padding="true"> <q-item v-for="plan in plans.data" :data="plan" :key="plan.id" clickable @click="btn(plan.id)" v-ripple active-class="text-orange-10 mnu_active" class="q-pb-md" >
-
Your not using
active
prop, item activates your active- class if active is true. https://quasar.dev/vue-components/list-and-list-items#Active-state -
Awesome! @metalsadman you are a saviour every time I struggle with Quasar … Thank you so much!
<q-item v-for="plan in plans.data" :data="plan" :key="plan.id" :active="thisOrder.planId==plan.id" active-class="text-orange-10 mnu_active" class="q-pb-md" >