Fred Guth
Fred Guth

Reputation: 1667

How to use vue components in a svelte app?

I really love using Svelte but at this moment, one of its cons is the lack of ready-to-use components for Svelte. I want to use vue-atlaskit in a project, but I really prefer using Svelte. Is it possible to use vue components inside a Svelte app?

I guess it all should be just "web-components", but I really don't know how to do it.

Upvotes: 3

Views: 1454

Answers (2)

Alen Siljak
Alen Siljak

Reputation: 2595

While not a comprehensive answer, I would add some findings on the topic:

As you suggested, I would try with Web Components. According to Custom Elements Everywhere the support for Web Components is fairly high for both frameworks. Vue states that the support is 100% although the site shows less so there is some discrepancy. But basic tests pass 100%. Svelte is also at 100%. This paints a fairly positive picture.

There is another question on SO that refers to consuming Web Components in Svelte.

Here is another reference article on how to create web components with Vue 3.

Note: I will try to update the answer as I learn more. I will be testing this out on a migration of a PWA from Vue to Svelte, where I plan first to use Svelte components in an existing Vue app and then perhaps switch to using Vue components in a Svelte app, depending on how things go with rewriting.

Upvotes: 2

Fred Guth
Fred Guth

Reputation: 1667

I checked with people in the Svelte Discourse. There is no simple way to do that. The suggestion is to convert the UI components I need from Vue to Svelte.

Upvotes: 3

Related Questions