Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ElMassimo/vue-custom-element-example

An example on how to define custom elements using Vue 3
https://github.com/ElMassimo/vue-custom-element-example

custom-elements demo tutorial vue vuejs3 web-components web-components-library

Last synced: 3 months ago
JSON representation

An example on how to define custom elements using Vue 3

Awesome Lists containing this project

README

        

[defineCustomElement]: https://v3.vuejs.org/guide/web-components.html#definecustomelement
[custom elements]: https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements
[demo]: https://vue-custom-element-example.netlify.app
[how to export]: https://github.com/ElMassimo/vue-custom-element-example/tree/main/package
[how to use them]: https://github.com/ElMassimo/vue-custom-element-example/tree/main/playground
[blog]: https://maximomussini.com/posts/vue-custom-elements/



Example


defineCustomElement(DarkModeSwitch)


This repo is an example on how to use the [`defineCustomElement`][defineCustomElement] API in Vue 3.

It contains examples on [how to export] Vue components as [custom elements], and [how to use them] in any app.

[__Read the blog post__][blog] for a step by step discussion.

## Demo 🚀

[Visit the live demo][demo] to see the custom element in action.

## Play 🎸

npm run dev: build the library and start the playground