Answer the question
In order to leave comments, you need to log in
Vue.js and the problem with embedding the application on another site. Who faced?
There is an application on vue.js + vuetify + router + vuex.
The task is to embed this SPA as a widget on another site.
I used this solution, it's the only one so far - https://itnext.io/vuidget-how-to-create-an-embedda...
Library - https://github.com/karol-f/vue-custom- element
The problem occurs specifically on one domain, where simply instead of an application, an empty block of comment content is displayed.
<vue-widget id="vue-widget" vce-ready="">
<div id="app"><!----></div>
</vue-widget>
<link href="/dist/static/css/app.36dd3e0b96e06ae6f3130a58cf185192.css" rel="stylesheet">
<script type="text/javascript" src="/dist/static/js/manifest.2ae2e69a05c33dfc65f8.js"></script>
<script type="text/javascript" src="/dist/static/js/vendor.614f0593bd5c53cf6320.js"></script>
<script type="text/javascript" src="/dist/static/js/app.1c44a427c10b2e559de0.js"></script>
Answer the question
In order to leave comments, you need to log in
Well. The solution, like the problem, is stupid.
I changed the router to "history" (a very long time ago) so that there are beautiful URLs, but the documentation says that you need to configure the web server with this approach if the SPA is not in the root directory and not in index.html.
https://router.vuejs.org/guide/essentials/history-...
Vue-router in history mode couldn't just work. And it worked on other domains, since I really placed them in index.html, at the root.
Quick solution: change from 'history' to 'hash mode', or just remove the 'mode' option in the router (because it is initially in this mode).
Otherwise, you need to set up a web server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question