1👍
✅
You need to require('path').default
. The .default
is necessary here because when you use require('path')
you’re just getting a JSON object back:
{ default: <VueConstructor> }
So no template or render function is defined within that object. However if you use .default
then you will actually get back an SFC in this case which can be transpiled down.
The alternative would be to use import
:
import MyVuetable from './components/MyVuetable.vue'
Vue.component('my-vuetable', MyVuetable)
Or alternatively, with syntax-dynamic-import
enabled:
Vue.component('my-vuetable', () => import('./components/MyVuetable.vue'))
Source:stackexchange.com