Vue project mock simulation data

The new project vue-cli generated in the build folder has no dev-server.js this file

It is replaced webpack-dev-conf.js file

It is only necessary to configure the mock data in this file:

We are using the express service from this framework, it is possible to use the express-router interfaces to compile these requests:

In further preparation of the route devServer

The last test route in a browser

 

Download the Google plug-json view to further beautify json data, there is also a plug-in devtools vue shall use this plug-in

Done, Mock basic data here also over the

 

Guess you like

Origin www.cnblogs.com/rmty/p/11418948.html