Hurry! Vue-resource could not submit post data path 404

I watched a video on the Internet, using the previous version of vue2.0, so the get and post configured with vue-resource are in the dev-server.js under build.js, while I am using the new version after vue2.0, so there are no dev-server.js files in the file directory.

I looked up the information on the Internet and found that the dev-server.js configuration of the new version of vue should be configured in webpack.dev.conf.js, as shown in figures 1 and 2, both of which are configured in webpack.dev.conf.js.

11
22

db.json3

33


db.jsongetPrice

4 figure 4

how to change the path problem? Ask for advice

Mar.21,2021

just put the local json in the static directory


you can try to replace it with axios,vue-resources, which is no longer maintained and is not recommended.

Menu