0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

vuetify3 メモ

Last updated at Posted at 2024-11-14

vuetify3のメモ

vue3 + <script lang="ts" setup> 記法
templateはpugで記載

v-data-table

headersの設定

{title, value}の配列をv-data-tableへ渡す。

const headers = [
  { title: "ユーザID", value: "userId" },
  { title: "ユーザ名", value: "userName" },
];

v-data-table(:headers="headers" :items="items")

チェックボックス付けて選択可能とする

show-selectを設定する
v-modelに設定した配列へ、id値が設定される。
id以外のフィールドを利用する場合、item-valueを設定する

const selectedIds = ref([]);

v-data-table(:headers="headers" :items="items"
    show-select v-model="selectedIds" item-value="userId")
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?