Vue.js is favored by many front-end developers because of its simple syntax, document-friendly, and progressive framework. Especially for beginners, getting started with Vue.js is much easier than the other two of the current three front-end frameworks. But at the same time, simple does not mean low level, there are still a lot of things to learn to make vue.js good, especially for beginners who have not been exposed to webPack building tools The scaffolding of Vue. Js has configured the packing command for us, we just need to input the command NPM run build, and a dist folder will be generated under the project, and the files under the dist folder are what we need, and we can deploy them to the server at the back-end If careful, in this case, we open the debugging tool, the console will report an error, inside the static files are not found If the path on the server is the root path, there is no problem, but we usually add the project path. We can change the configuration in config/index.js. We need to change the relative path to static text The files are relative to index.html, so change them to the following

Paste_Image.png



www.example.com/test





Paste_Image.png

Add the publicPath to the generateLoaders function in the build/utils.js file and repackage it. The generated path in the CSS will be.. /.. / static/img find path so that you can correct the 4. Vue – cli development how to use Vue cross-domain – cli when we will cross domain problems, if the callback interface to the Vue – cli has built-in proxy plugin, we correct configuration.

Paste_Image.png


axios.post('/informationService')Copy the code

Then NPM run dev opens the project again without cross-domain problems. The original link www.noob6.com/archives/11…