Reputation: 1535
Im trying to use Vue Grid Layout: https://github.com/jbaysolutions/vue-grid-layout in my application (Using Vue2)
I have a "dashboard" component, where I want to use the grid layout, however getting errors when trying to import the files into the component - Im getting the error:
Failed to mount component: template or render function not defined. found in GridLayout
What im doing is importing the components and then registering them:
import GridLayout from 'vue-grid-layout';
import GridItem from 'vue-grid-layout';
And then registering :
components: {
"GridLayout": GridLayout,
"GridItem": GridItem
}
Any ideas why this is not working?
Upvotes: 1
Views: 1826
Reputation: 23968
You try to import two different named exports from that package. That requires a different syntax:
import { GridLayout } from 'vue-grid-layout';
import { GridItem } from 'vue-grid-layout';
Upvotes: 3