小编Vin*_*ers的帖子

Change background of v-data-table row on event from child component

I have an expanding data table in my parent component and a child component inside the expanded row with a button. I would like to change the background color of the associated row when I click the button inside the child component. I'm not sure how to target the row to add the css class on event.

ScanGrid(parent):

    <template>
      <v-flex v-if="items.length === 0">
        <ScanAdd @selectBatch="showScan" />
      </v-flex>
      <v-card v-else class="ma-5">
        <v-card-text>
          <v-layout align-center>
            <v-data-table
              :headers="headers"
              :items="items"
              item-key="StorageName"
              show-expand
              single-expand
              :expanded="expanded" …
Run Code Online (Sandbox Code Playgroud)

vue.js vuetify.js

5
推荐指数
1
解决办法
138
查看次数

标签 统计

vue.js ×1

vuetify.js ×1