Everyone asks you a question: how to upload the Vue project to GitHub to realize the preview after it is packaged?

how to upload the Vue project to GitHub to realize the preview function
is it only necessary to upload the dist file?
what if the cart.json data cannot be read when the dist file style fails?

Nov.25,2021

you can put the package result of the Vue project in the corresponding project gh-pages.

  1. submit the project to the warehouse (including the dist directory) if the warehouse name is test.
  2. $git subtree push-- prefix dist origin gh-pages , submit the dist directory to gh-pages.
  3. enter https://< your github name > .github.io / test/ in the address bar to view the page.
The failure of the

style may be the cause of the error in the reference path. If you are building a project using Vue-cli3.0, you need to set baseUrl:'/ staff/' in vue.config.js .

For the problem that cart.json data cannot be read, you need to provide how cart.json is read in the project. Can the specific code be displayed?


you can use GitHub Pages

Menu