11ty / eleventy-plugin-vue

Use Vue.js templates and Vue.js single file components in Eleventy.
195 stars 11 forks source link

Dynamically import component #4

Open huguestennier opened 4 years ago

huguestennier commented 4 years ago

When trying to dynamically import component based on a props like this:

computed: {
    dynamicComponent() {
      return () => import(`./component.vue`);
    }
}

We get this error:

`TemplateContentRenderError` was thrown
> render function or template not defined in component: anonymous
zachleat commented 4 years ago

Related might be an upstream issue https://github.com/vuejs/rollup-plugin-vue/issues/328