Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import doesn't work #2

Closed
idkw opened this issue Feb 11, 2018 · 2 comments
Closed

Import doesn't work #2

idkw opened this issue Feb 11, 2018 · 2 comments

Comments

@idkw
Copy link

idkw commented Feb 11, 2018

I cannot manage to import vue2vis component with a super basic setup :

<template>
  <div>
    <timeline ref="timeline" :items="items" :groups="groups" :options="options">
    </timeline>
  </div>
</template>
<script>
import Timeline from 'vue2vis'
export default {
  name: 'MyTimeline',
  components: {
    Timeline
  },
  data () {
    return {
      groups: [{
        id: 0,
        content: 'Group 1'
      }],
      items: [{
        id: 0,
        group: 0,
        start: new Date(),
        content: 'Item 1'
      }],
      options: {
        editable: true
      }
    }
  }
}
</script>
<style scoped></style>

The error thrown is :

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

@alexcode
Copy link
Owner

I think you should either use a destructuring assignment like import { Timeline } from 'vue2vis' or simply import Timeline from 'vue2vis.Timeline'.

@idkw
Copy link
Author

idkw commented Feb 13, 2018

Thanks, works with import { Timeline } from 'vue2vis'

@idkw idkw closed this as completed Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants