@@ -182,7 +182,8 @@ async function buildConfiguration(ctx: VuetifyNuxtContext) {
182182 if ( typeof labComponents === 'boolean' ) {
183183 config . imports . push ( 'import * as labsComponents from \'vuetify/labs/components\'' )
184184 config . labComponents . add ( '*' )
185- addDatePicker = false
185+ if ( ctx . vuetify3_4 === false )
186+ addDatePicker = false
186187 }
187188 else if ( typeof labComponents === 'string' ) {
188189 useLabComponents . push ( labComponents )
@@ -217,25 +218,38 @@ async function buildConfiguration(ctx: VuetifyNuxtContext) {
217218 config . labComponents . add ( component )
218219 } )
219220
220- if ( dateOptions && ! config . labComponents . has ( 'VDatePicker' ) ) {
221+ if ( ctx . vuetify3_4 === false && dateOptions && ! addDatePicker ) {
221222 const entry = componentsToImport . get ( 'VDatePicker' )
222223 if ( entry ) {
223224 entry . push ( 'VDatePicker' )
224225 config . labComponents . add ( 'VDatePicker' )
226+ addDatePicker = false
225227 }
226228 }
227229
228230 componentsToImport . forEach ( ( componentsArray , from ) => {
229231 config . imports . push ( `import {${ componentsArray . join ( ',' ) } } from 'vuetify/labs/${ from } '` )
230232 } )
231- addDatePicker = ! config . labComponents . has ( 'VDatePicker' )
232233 }
233234 }
234235
235236 // include date picker only when needed
236237 if ( dateOptions && addDatePicker ) {
237- config . imports . push ( 'import {VDatePicker} from \'vuetify/labs/VDatePicker\'' )
238- config . labComponents . add ( 'VDatePicker' )
238+ let warn = true
239+ if ( typeof ctx . vuetify3_4 === 'boolean' ) {
240+ warn = false
241+ if ( ctx . vuetify3_4 ) {
242+ // @ts -expect-error VDatePicker is on labs when version < 3.4
243+ config . components . add ( 'VDatePicker' )
244+ config . imports . push ( 'import {VDatePicker} from \'vuetify/components/VDatePicker\'' )
245+ }
246+ else {
247+ config . labComponents . add ( 'VDatePicker' )
248+ config . imports . push ( 'import {VDatePicker} from \'vuetify/labs/VDatePicker\'' )
249+ }
250+ }
251+
252+ warn && logger . warn ( 'Unable to load Vuetify version from package.json, add VDatePicker to components or labComponents' )
239253 }
240254
241255 // components entry
0 commit comments