axios request VUE-CLI3 local project file 404 json

Note: The difference cli3 and cli2 of:
1. static resource files into a directory of static public
under 2. can not .json files directly into the public, must be placed under public / js (create your own js directory)
3. reference as follows :

axios.get("/js/tagList.json").then(data => {
this.tagList = data.data;
});

Reference link: http: //www.imooc.com/article/details/id/291839

Guess you like

Origin www.cnblogs.com/yoyotl/p/12127583.html