darrenfang / vuetify-datetime-picker

DatetimePicker component for Vuetify.js. https://darrenfang.github.io/vuetify-datetime-picker/
MIT License
175 stars 127 forks source link

Errors if using full installation #38

Open yaroslawww opened 5 years ago

yaroslawww commented 5 years ago

I use full installation of vuetify https://vuetifyjs.com/en/getting-started/quick-start#full-installation

import Vue from 'vue';
import Vuetify from 'vuetify/lib';
import DatetimePicker from 'vuetify-datetime-picker';
import '@mdi/font/css/materialdesignicons.css';

Vue.use(Vuetify);
Vue.use(DatetimePicker);
export default new Vuetify({
  theme: {
    themes: {
      light: {
        primary: '#06f',
        secondary: '#424242',
        accent: '#82B1FF',
        error: '#FF5252',
        info: '#2196F3',
        success: '#4CAF50',
        warning: '#FFC107',
      },
    },
  },
  icons: {
    iconfont: 'mdi',
  },
});

But after adding datepicker there components errors image

hurzeler commented 5 years ago

I can confirm that I have the same issue. Is there no need to add

import 'vuetify-datetime-picker/src/stylus/main.styl'; // <-- Needed?

I get the same issue with the main.styl added.

hurzeler commented 5 years ago

For

"vue": "^2.6.10",
"vuetify": "^2.0.7"

You can fix the issue by registering all the missing components.

import DatetimePicker from 'vuetify-datetime-picker'
import 'vuetify-datetime-picker/src/stylus/main.styl'
import { VTextField, VDialog, VBtn, VCard, VSpacer, VCardText, VCardActions, VTabs, VTab, VIcon, VTabItem,VDatePicker, VTimePicker } from 'vuetify/lib';

Vue.component('v-icon', VIcon);
Vue.component('v-dialog', VDialog);
Vue.component('v-btn', VBtn);
Vue.component('v-card', VCard);
Vue.component('v-spacer', VSpacer);
Vue.component('v-card-text', VCardText);
Vue.component('v-card-actions', VCardActions);
Vue.component('v-tabs', VTabs);
Vue.component('v-tab', VTab);
Vue.component('v-tab-item', VTabItem);
Vue.component('v-date-picker', VDatePicker);
Vue.component('v-time-picker', VTimePicker);
Vue.use(DatetimePicker);

I am not sure what is wrong and the solution doesn't look right but it works.

darrenfang commented 5 years ago

You can try the latest version 2.1.0

marena commented 5 years ago

"vue": "^2.6.10", "vuetify": "^2.0.19", "vuetify-datetime-picker": "^2.1.0",

Still same error, right now I'm using @hurzeler solution.

darrenfang commented 5 years ago

@marena Can you provide a demo repository? After some research, I cannot find the error. ☹️