How do I get the selected rows from a v-data-table? (Vuetify)

Afo*_*nso 5 datatable vue.js vuetify.js

I am using a v-data-table, with the option "show-select", which shows checkboxes behind every row, but I have no idea how to actually know which rows are checked and get their values...

This is the code

<v-data-table
   :headers="TopicHeaders"
   :items="allTopics"
   :search="searchTopics"
   show-select
   class="elevation-1"
   item-key="name"
></v-data-table>
Run Code Online (Sandbox Code Playgroud)

Thank you

Zim*_*Zim 6

选定的行绑定到v-model数据表的值 ( )。这应该很简单...

<v-data-table
   v-model="selected"
   :headers="TopicHeaders"
   :items="allTopics"
   :search="searchTopics"
   show-select
   class="elevation-1"
   item-key="name"
></v-data-table>
Run Code Online (Sandbox Code Playgroud)

现在检查的行存储在selected数组中。有关如何在使用自定义插槽时操作行的示例,请参阅我的答案此处selected