1

I am currently looking to build a multi-page Vue app which will allow users to embed it easily into their websites and allow their website visitors to interact with it seamlessly.

The app itself will interact with an API, have few pages, and I'd like to use Vue and it's ecosystem to achieve it (vue-router, pinia).

I am exploring few options but currently I am quite interested in using web components, specifically to have one web component wrap the entire application. While doing this, I noticed that, considering there is no app instance, initializing pinia and vue router cannot be done, other than creating a temporary instance and copying the context, which sounds a bit hacky to me.

Does anyone have experience with this kind of project and how do you recommend developing it? Do you think web components are the best solution?

Really appreciate all input in advance.

I considered few options and considering Vue is my framework of choice, I decided to use it based on the documentation.

Also I found Lit and Stencil, but considering I'd like to build this project in Vue, I decided against it.

3
  • 1
    Related to stackoverflow.com/questions/69808113/… . Vue WC isn't a very good choice for an embeddable widget. Regular Vue app that's mounted to a specific container on a page should work. You can still use shadow DOM instead of iframe to isolate it from the rest of the page. Commented Nov 10, 2023 at 20:08
  • Thank you for feedback @EstusFlask, why do you think Vue WC is not a very good choice? Commented Nov 10, 2023 at 22:16
  • Exactly for the reason you listed, you'll need to jump through hoops with no app instance, and there are no real benefits Commented Nov 10, 2023 at 22:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.