How to globally reference js public files and stylus variable files in vue

how to globally reference js public files and stylus variable files in vue

Mar.28,2021

write to main.js


vue introduces js: < script > and css: < style >, all through src
if vue has introduced js files, then in the corresponding js file import
if it is a public function used in a large area, import


in main.js

stylus references global variables to modify build/utils.js files

stylus: generateLoaders('stylus',{import:[path.resolve('./src/shared/shared.styl')]}),

js public files do not know what you are going to do, but it is recommended to use vuex if you want to share variables. If you just need to execute some code before vue loads, you can introduce

into main.js.
Menu