Use vue-custom-element with vue-class-component and Typescript for Angular
See original GitHub issueuse vue-custom-element to create Web-component in Vue and use it in Angular. It works fine for Vue+js:
import Vue from 'vue'
import Calculator from './components/Calculator.vue'
import vueCustomElement from 'vue-custom-element'
Vue.use(vueCustomElement)
Vue.customElement('js-calculator', Calculator)
and I use in Angular at index.html:
<body>
<app-root></app-root>
<js-calculator msg="30"></js-calculator>
</body>
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?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to create Web-component in Vue+typescript for Angular?
The correct answer: On typescript instead of. Vue.customElement('ts-calculator', Calculator). we should use. Vue.
Read more >Issue #173 · karol-f/vue-custom-element - TypeScript support
When I create a vanilla TypeScript project using vue-cli I get the following javascript error when initializing the custom element.
Read more >How To Write Class-Based Components with Vue.js and ...
In this article, you learned how to use vue-class-component and vue-property-decorator to support TypeScript in Vue.js class-based components.
Read more >How to use the vuejs component in an angular project
Let's do it. Here in the angular main html template, we add a vue custom component: <script src="https://unpkg.com ...
Read more >How to use TypeScript to Create Vue Apps with Vue Class ...
The vue-class-component library is only compatible with Vue.js 2. In this article, we'll look at how to create Vue.js apps with class-based ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It works!
Many thanks for the help. You saved my weekend
Or this https://github.com/karol-f/vue-custom-element/issues/173#issuecomment-535417935
I can’t check it now