2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Vuetify3でv-date-picker復活!

Last updated at Posted at 2023-08-14

この記事の内容

Nuxt3でフォーム処理を作成した際に、
Vuetifyのv-date-pickerの使い方につまずいたので備忘録として残しておく。

v-date-picker

公式にのっているようなコンポーネントです。
予約システムなどの入力に使えそうですね。

Vuetify2においてv-date-pickerは通常コンポーネントとして使用できますが、
Vuetify3リリース当初v-date-pickerは削除されました。
しかし、2023年6月14日リリースv3.3.4 からv-date-pickerが復活するとのことです。

つみポイント

さっそく使ってみようと思いコーディング ・・・表示されない?

sample.vue
<template>
	<div>
		<v-date-picker></v-date-picker>
    </div>
</template>
<script lang="ts" setup>

</script>

image.png

v-date-picker使い方

なんで使えないんだとissuesを調べた結果1つのissueにたどり着いた。
Vuetifyの最新v3.3.12(2023年8月13日に確認)では常設のコンポーネントとして存在しないらしい。
代わりに現在ではVuetify Labs で利用できるようになったとのこと。
Vuetify Labsの機能は<script>importすると使えるようになるらしい。

sample.vue
<template>
  <div>
    <v-date-picker></v-date-picker>
  </div>
</template>

<script lavng="ts" setup>
  import { VDatePicker } from 'vuetify/labs/VDatePicker'
</script>

image.png

追記 (2024/02/25)

3.4で標準使用できるようになったみたいです!
いずれにせよVuetify Labsがあることは忘れずにしていきたい。
https://vuetifyjs.com/en/components/date-pickers/

まとめ

常設していない機能はLabsから使えるかもしれないのでRelease notesと共に要チェック!

参考文献

  1. 公式-date-picker
  2. Vuetify2
  3. Vuetify v3.3.4
  4. [Bug Report][3.0.3] v-date-picker doesn't exist #16191
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?