Home >Web Front-end >JS Tutorial >How to deal with the white screen on the homepage after vue build is packaged

How to deal with the white screen on the homepage after vue build is packaged

php中世界最好的语言
php中世界最好的语言Original
2018-04-11 16:32:173301browse

This time I will show you how to deal with the white screen on the homepage after vue build is packaged. What are the precautions when dealing with the white screen on the homepage after vue build is packaged? Here are practical cases, let’s take a look. one time.

1. Problem description

There is no problem browsing the local Vue project on the server side, but after executing npm run build and packaging, the local preview shows a white screen. There are a lot of js, and the css cannot be loaded.

2. Solution

Find index.js in the config folder, open it and change assetsPublicPath: '/' to

How to deal with the white screen on the homepage after vue build is packaged

Just execute npm run build again.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How Native uses fetch to implement image upload function

How Vue.js implements images that can be dragged and placed at will

The above is the detailed content of How to deal with the white screen on the homepage after vue build is packaged. 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