vue uses axios to request local json files

When developing a project, many times the background interface may not be as fast as the development of the foreground. We need to write the json file ourselves, so that we can combine the static page and logic to debug. When the interface is written in the background, we only need to Just replace the request address.

In the vue project, we generally use axios to request interface data, so how to write the request path of the local json file?

Project structure:

Everyone must pay attention that the local json file is placed in the static file

Write this in the vue that calls the json file


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326225852&siteId=291194637