VueCli4.x 需要在public目录下创建data目录,将json文件保存至此文件夹下。

使用axios请求即可

axios.get('/data/user.json')
	.then(function (response) {
	console.log(response);
})
.catch(function (error) {
	console.log(error);
});

相关文章:

  • 2021-05-02
  • 2021-09-27
  • 2021-05-26
  • 2021-08-01
  • 2022-12-23
  • 2021-11-19
  • 2021-12-03
猜你喜欢
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案