故事书不支持vuetify的v-calendar

时间:2020-10-30 09:38:42

标签: typescript vuejs2 vuetify.js storybook vcalendar

我尝试如下从Storybook中的vuetify添加v-calendar组件,但是它无法加载,并显示下图所示的错误。不支持吗? v-date-picker也是如此。

包装: “ @ storybook / vue”:“> = 5.3.0”, “ vue”:“ ^ 2.6.11”, “ vuetify”:“ ^ 2.2.11”,

//calendar.vue
<template>
  <div>
    <v-calendar color="primary"
      ref="calendar"
        v-model="focus"
        type="category"
        category-show-all
        :categories="categories"
        :events="events">
    </v-calendar>
  </div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
import Vuetify from "vuetify";
Vue.use(Vuetify);

@Component
export default class Calendar extends Vue {
  @Prop({default:()=>{ return []}}) detectionsData!: [];

  focus= '';
  events= [];
  categories= ['John Smith', 'Tori Walker'];  
}
</script>

enter image description here

// calendar.stories.ts
import myCalendar from "../components/Calendar.vue";
import '@mdi/font/css/materialdesignicons.css';
import 'vuetify/dist/vuetify.min.css';

export default {
    title: 'Calendar-View',
    component: myCalendar,
};
const Template = (args: any, { argTypes }: any) => ({
    props: Object.keys(argTypes),
    components: { myCalendar },
    template: '<my-calendar/>',
});

Template.args = {}

export const Default = Template.bind({});
Default.args = ({})

1 个答案:

答案 0 :(得分:0)

为日历组件提供以下属性后,此问题已解决

locale="en"