Recently studying Vue Scaffolding , When packaging a project , The following problems arise , Summed up their own problems and Solutions .

* The project clearly runs without error, but there is no data after packaging
There are two possible reasons for this :
1.1) The first is the wrong path after packing ==> solve : You can click it first dist In the file index.html to glance at , You will find that there is one more path in front of each path .
, At this time, we need to package.json Create a directory named babel.config.js Documents of , Code in it : module.exports = {
presets: [ '@vue/cli-plugin-babel/preset' ] }
1.2) The second reason may be Vue-router Used in history pattern ,【Vue-router
Among them hash Mode and history pattern ,vue The default route for is hash pattern 】, The easiest way is to history Just comment out the mode , as follows :
const router = new VueRouter({ // mode: 'history', base: process.env.BASE_URL,
routes})
2. One of the problems we still have is , An error occurred while executing the pack and go command , We need to take a look at this time package.json Is the command in the file consistent with the command we executed , as follows
It's obvious at this point , Our execution package command should be :
npm run build:prod

So if we're in the middle of executing a command ‘xxx No time ’, Don't worry , We can go first package.json Check the file to see if there are any objects we need , Including the example we added by executing the command element-ui,vuex,vuex-router wait .

Technology
©2019-2020 Toolsou All rights reserved,
It's unexpected Python Cherry tree (turtle The gorgeous style of Library )Unity3D of UGUI Basics -- Three modes of canvas os Simple use of module computer network --- Basic concepts of computer network ( agreement , system )html Writing about cherry trees , Writing about cherry trees Some East 14 Pay change 16 salary , Sincerity or routine ?Unity-Demo Examples ✨ realization UI- Backpack equipment drag function 06【 Interpretation according to the frame 】 Data range filtering -- awesome java Four functional interfaces ( a key , simple )