Home  >  Article  >  Web Front-end  >  File path error after packaging through Vue (detailed tutorial)

File path error after packaging through Vue (detailed tutorial)

亚连
亚连Original
2018-06-01 10:17:561410browse

Below I will share with you an article to solve the problem of file path error after Vue packaging. It has a good reference value and I hope it will be helpful to everyone.

Here is the project created by vue-cli as an example

1. The file path is incorrect

Find the index.js file in the config folder and modify the location

See clearly that it is build (there is also a dev above which is in the development environment) Configuration, no changes required) under assetsPublicPath: Change '/' to './'

##2. The background image path is incorrect

The path of background-img written in css is wrong. You need to find utils.js in the build folder and modify the location.

Add it to the red box field.

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Solve the problem that lower version browsers do not support the import of es6

Use vuex to achieve login status The storage and non-logged-in status do not allow browsing, what are the specific methods?

Detailed explanation of the four methods of event binding this in react

The above is the detailed content of File path error after packaging through Vue (detailed tutorial). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn