Answer the question
In order to leave comments, you need to log in
Why are styles not always applied to vue SPA?
I do it with @vue/cli if it's important, I run npm run serve/
I'm doing a small project, so it's convenient for me to put all the styles into one style.css file, which I connected to the root single html file.
I have VueRouter connected - if I go through the route through the interface, everything is fine, the styles are applied, but if I go to some kind of route (in particular, dynamic) and refresh the page there, then the content is there, and all the styles just disappear.
Or if you go like this localhost:8080/catalog and update, then everything is fine, localhost:8080/catalog - add a slash and again all styles disappear ..
Why is this happening, how to fix it?
Answer the question
In order to leave comments, you need to log in
In the root component of the app, in the styles section, add@import './path/to/your/common/styles.css';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question