How to refer to global style issues in vue projects?

  1. recently defined a global style in a project
  2. the file is under src/assets/css/
  3. then introduce this style in the relative path in main.js
  4. then Red in the project directly uses clss to modify styles such as marggin, font

however, the problem arises. When packaged to the test environment, the style does not take effect when opens the page for the first time. When the page is refreshed, the style takes effect . Is the style file placed in the wrong place when requested? Should I put it under the static folder?

Oct.26,2021

write a global css file, and then quote it in App.vue 's style:

@import './assets/css/';

Global styles can be placed in index.html. Css can be placed in static without relying on vue


main.js to directly introduce import 'path'

.
Menu