Ant Design Pro Vue cannot be previewed locally after packaging

About the problem that the Ant-Design-Pro-Vue project cannot be previewed after packaging.
The packaged dist folder
Insert image description here

Open index.html
Insert image description here
and it is always in the loading state
. Since the official does not clearly explain the configuration and deployment after packaging, beginners think that they can preview it by opening index.html. To preview the
packaged project, you need to deploy it on the server.

However, the back-end is generally responsible for the server. Of course, the front-end can also build a
local service based on node.js+express.
For details, please refer to the article https://blog.csdn.net/weixin_43835425/article/details /103101571

Download the Express template.
Insert image description here
Copy the contents of the packaged dist folder to the public folder.
Insert image description here
Execute npm start in the Express folder
Insert image description here
to open the port number http://localhost:3000.

Insert image description here
Preview successful

Guess you like

Origin blog.csdn.net/weixin_43835425/article/details/108189970