Is any way to pass a template to extended component? Example, that illustrates the problem:
There is a component named Slide
with a template like so:
(This question is similar to this SO question. I am just gonna share a similar answer I post for that question here.)
The trick is simple. Basically, when extending, create a new component that registers Parent
as a local component.
Demo: https://jsfiddle.net/jacobgoh101/omjgmb3f/
const Slide = Vue.extend({
components: {
Parent
},
template: `
I am a slot
`
});
new Slide().$mount('#container')