I went through the existing closed issues and I was successfully using the options to init the custom element like this:
Vue.customElement('some-component',(someComponent as any).options);
And this works great. Now I have introduced router to the component and I'm having issues with it.
If I try to attach the router like:
someComponent.router = router; It doesn't work.
If I try to set it up like this:
Vue.customElement('some-component', { router, render: h => h(someComponent) });
This works but the problem is that props are not being passed anymore from the component.
So <some-component anyProp="test"></some-component> will not work anymore as anyProp is undefined now. But the router works in that case.
Hi,
So trying to wrap my head around this one.
I went through the existing closed issues and I was successfully using the options to init the custom element like this:
Vue.customElement('some-component',(someComponent as any).options);
And this works great. Now I have introduced router to the component and I'm having issues with it.If I try to attach the router like:
someComponent.router = router;
It doesn't work.If I try to set it up like this:
Vue.customElement('some-component', { router, render: h => h(someComponent) });
This works but the problem is that props are not being passed anymore from the component. So<some-component anyProp="test"></some-component>
will not work anymore asanyProp
is undefined now. But the router works in that case.Any solution much appreciated.