question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use vue-custom-element with vue-class-component and Typescript for Angular

See original GitHub issue

use 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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
KirillRadchenkocommented, Aug 6, 2021

It works!

Many thanks for the help. You saved my weekend

0reactions
karol-fcommented, Aug 6, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found