CroudTech / vue-fullcalendar

FullCalendar Wrapper for vue
MIT License
483 stars 100 forks source link

Component only works when registered via Vue.use() #138

Closed mtimofiiv closed 6 years ago

mtimofiiv commented 6 years ago

Works like so:

import Vue from 'vue';
import FullCalendar from 'vue-full-calendar';

Vue.use(FullCalendar);
<template>
  <full-calendar></full-calendar>
</template>

If you try to do this:

<template>
  <calendar></calendar>
</template>
<script>
import calendar from 'vue-full-calendar';

export default {
   components: {
     calendar
   }
}
</script>

You get Failed to mount component: template or render function not defined

BrockReece commented 6 years ago

Hey, the following should work...

import { FullCalendar } from 'vue-full-calendar'
export default {
  components: {
    FullCalendar,
  },
}
mtimofiiv commented 6 years ago

@BrockReece tried that! Still having the issue. The name of the import does not seem to affect it.

BrockReece commented 6 years ago

@mtimofiiv this is working for me in this sandbox https://codesandbox.io/s/1zz00qvnzl

Btw, this isn't about the name of the import, this is specifically exporting the FullCalendar component as opposed from exporting the default Vue plugin.

import { FullCalendar } from 'vue-full-calendar'

Hope that helps?

mtimofiiv commented 6 years ago

Sorry, misread that, did not notice the destructuring! Now it works.

BrockReece commented 6 years ago

Great