Custom Element with TypeScript
See original GitHub issueI see there are type definitions for custom elements, however it’s not immediately clear how to use them.
My index.ts file looks like this:
import Vue from "vue";
import * as VueCustomElement from "vue-custom-element";
import Footer from "./components/footer/codigo-footer.vue";
Vue.use(VueCustomElement);
Vue.customElement('codigo-footer', Footer);
Which is how I would create custom elements in vanilla JS. Vue.customElement is throwing a TypeScript error: Property ‘customElement’ does not exist on type ‘VueConstructor<Vue>’
Am I going about this incorrectly?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Creating a Custom Element Decorator Using TypeScript
In the post I showed you how you can build your own TypeScript decorator in order to remove some of custom elements boilerplate...
Read more >TypeScript 2.1 Custom Elements - Stack Overflow
a shim that allows the native Custom Element API to be used with ES5 (and thus transpiled TypeScript). The release notes for TypeScript...
Read more >Defining a component - Lit.dev
Define a Lit component by creating a class extending LitElement and registering your class with the browser: @customElement('simple-greeting')
Read more >How to use Web Components with TypeScript and React
Learn how to use Web Components with TSX TypeScript and React components. ... With the recent support for Custom Elements, we can now...
Read more >Using custom elements - Web Components | MDN
This article introduces the use of the Custom Elements API. ... reliably be transpiled in Babel 6 or TypeScript targeting legacy browsers.
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 Free
Top 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
I’m on vacation for a couple days, but I will definitely look into this when I get home.
@isaaclyman Is it possible for You to answer this issue?
It’s regarding this PR https://github.com/karol-f/vue-custom-element/pull/38