vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.95k stars 6.96k forks source link

[Bug Report][3.0.3] v-date-picker doesn't exist #16191

Closed tassin-gauthier closed 1 year ago

tassin-gauthier commented 2 years ago

Environment

Vuetify Version: 3.0.3 Vue Version: 3.2.45 Browsers: Chrome 107.0.0.0 OS: Mac OS 10.15.7

Steps to reproduce

<v-date-picker v-model="date"></v-date-picker>
const date = ref('2022-01-01')

Expected Behavior

the v-date-picker component should be displayed

Actual Behavior

It display an error: "Failed to resolve component: v-date-picker"

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

It work for v2.x versions but doesn't work for v3.x. I don't understand because it's present on phase 4 of the migration notion: https://www.notion.so/d107077314ca4d2896f0eeba49fe8a14?v=5cc7c08e9cc44021a7c86a20f189b0ba. There is also a problem with the documentation because the "date-picker" is not present on the left menu, but it's referenced on google when you type "vuetify 3 date-picker" : https://next.vuetifyjs.com/en/components/date-pickers/

JoakimFFCG commented 2 years ago

The date picker component isn't included in the 3.0 release. It will be added in 3.1. See https://github.com/vuetifyjs/vuetify/milestone/56

It might be released a bit earlier in a preproduction state with "Labs", whatever that is. See https://next.vuetifyjs.com/en/introduction/roadmap/#labs

jeremyVignelles commented 1 year ago

Is the 3.1 milestone still accurate ? I don't see any mention of date-picker in the 3.1 milestone

EDIT: found it here : #13480 . It seems like it doesn't have any ETA yet.

etrielQ commented 1 year ago

I still don't see component 'date-picker' in vuetify documentation

JoakimFFCG commented 1 year ago

@etrielQ Seems like the date picker component was removed from the 3.1 milestone. It still isn't released yet. See #13480 for status updates.

stratdev3 commented 1 year ago

datepicker component missing in v3 is still the main reason why i'm always using the v2. sad

ghost commented 1 year ago

This is the only reason why I can't switch to Vuetify 3, it's just impossible to work with the UI without v-date-time. Sad. :disappointed:

MarinaMWestling commented 1 year ago

So just going to leave this here because I was also struggling to find the date picker. Looks like they have a type of date on the v-text-field. You can see it on the advanced section of the expansion panels on vuetify 3.

mcrapts commented 1 year ago

Thank you @MarinaMWestling. No idea why this isn't documented but this is good enough for me!

stratdev3 commented 1 year ago

@MarinaMWestling the type date is the one from underlying input tag from browser/os. Not really the former in v2 which offers a ton of great features.

MFJamil commented 1 year ago

So just going to leave this here because I was also struggling to find the date picker. Looks like they have a type of date on the v-text-field. You can see it on the advanced section of the expansion panels on vuetify 3.

Sorry but the link is pointing to Vuetify 2 page and not Vuetify 3. The equivalent link for Vuetify 3 is the following: https://next.vuetifyjs.com/en/components/expansion-panels/

michael-scheurer commented 1 year ago

It's now available with Vuetify Labs. You need to

dderrek commented 1 year ago

Thank you @michael-scheurer for mentionning that the v-date-picker is now available. I could successfully set it up by following your steps, however I had to do one more thing for setting it up using the options API:

Wth the composition API this step should not be needed.

JenuelDev commented 1 year ago

any alternative? since we cant use datepicker?

etrielQ commented 1 year ago

any alternative? since we cant use datepicker?

Version 3.3.4 introduced the date-picker feature to Vuetify 3 https://vuetifyjs.com/en/components/date-pickers/

missmay4 commented 1 year ago

Im trying to use v-date-picker with Vue3 and Vuetify3 but the console gaves me this warn and the component doesn't show the date picker:

[Vue warn]: Failed to resolve component: v-date-picker If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.

Even if in include the VDatePicker in the components property with vue-labs. What am I doing wrong?

This is my main.js

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import './assets/styles/main.css'

// Vuetify
import 'vuetify/styles'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'

// Bootstrap
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap'
import 'bootstrap-icons/font/bootstrap-icons.css'

const vuetify = createVuetify({
  components,
  directives,
})

const app = createApp(App)

app.use(router)
app.use(vuetify)

app.mount('#app')
dderrek commented 1 year ago

I assume with "include the VDatePicker in the components property" you're refering to my comment. I only had to do it using the Options API. From your code I cannot say whether it is the Options or Composition API (I am still a Vue junior ;-)). But you should anyway make sure that you import the VDatePicker like michael-scheurer mentionned in his comment.

missmay4 commented 1 year ago

Thanks for the answer!

Yes! Im import the VDatePicker like this comment says, but nothing happen, the datepicker doesnt show.

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import './assets/styles/main.css'

// Vuetify
import 'vuetify/styles'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
import { VDatePicker } from 'vuetify/labs/VDatePicker'

// Bootstrap
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap'
import 'bootstrap-icons/font/bootstrap-icons.css'

const vuetify = createVuetify({
  components,
  directives,
  VDatePicker,
})

const app = createApp(App)

app.use(router)
app.use(vuetify)

app.mount('#app')

The console give me this warning:

Projects.vue:755 [Vue warn]: Failed to resolve component: v-date-picker If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <ProjectsDPMT onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy(Object) {getProjects: ƒ, showHiddenTableElements: ƒ, showTableElements: ƒ, sortByType: ƒ, sortByTier: ƒ, …} > > at <RouterView> at <App>

Im using the datepicker component this way: inside of a v-container and a v-menu. In this example works perfectly but in my project doesn't open the date-picker.

My Vue version is 3.3.2 and my Vuetify version is 3.3.19.

kosukhin commented 1 year ago

@missmay4 Hi. you need to use VDatePicker inside concrete component in it's components field for example

name: 'ComponentA',
components: {
   VDatePicker
}

Or register VDatePicker component as global component like this

app.component('VDatePicker', VDatePicker)

First variant works for me, second I did not test, but it will work I think

missmay4 commented 1 year ago

Thanks so much @kosukhin you save my life! It works perfectly with the second option.

I didn't know that i have to import like that, in the documentation doesnt says anything.

Have a nice day!

thomktz commented 1 year ago

@missmay4 Btw, running with vuetify 3.4.4, I had to use

import { VDatePicker } from 'vuetify/components/VDatePicker'

and not

import { VDatePicker } from 'vuetify/labs/VDatePicker'