Closed KirillRadchenko closed 3 years ago
Hi, please try
import Test from "./components/Test.vue";
Vue.customElement("test-component", Test.prototype.constructor.options);
Regards
Hi, many thanks for your answer.
I use typescript v. 4.1.6 and I got: "Property 'options' does not exist on type 'Function'", so I used
Vue.customElement("test-component", Test.prototype.constructor.arguments);
Is this correct?
But I got the same problem. Web-component was created, but it's still not visible in Angular
Most likely not. You can also try
Vue.customElement('my-widget', new Test().$options)
But it's worse option as it double init component.
Best to prepare CodeSandbox example and I will try to check it.
Or this https://github.com/karol-f/vue-custom-element/issues/173#issuecomment-535417935
I can't check it now
It works!
Many thanks for the help. You saved my weekend
use vue-custom-element to create Web-component in Vue and use it in Angular. It works fine for Vue+js:
and I use in Angular at index.html:
It works fine. But when I use typescript and vue-class-component in Vue (instead of javascript) and the same code, I don't see web-component in Angular. Vue+ts calculator works in a separate app too.
What could be the problem?