VueCli4.x 需要在public目录下创建data目录,将json文件保存至此文件夹下。
使用axios请求即可
axios.get('/data/user.json') .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });