fast mock官网地址:https://www.fastmock.site/#/projects
1、创建项目
2、添加接口
3、使用接口
<script> import axios from 'axios' export default { created() { const url = 'https://www.fastmock.site/mock/4691d3c781e8db1a1bd9867451135f64/weekly/user' axios.get(url).then(({ data }) => { console.log(data) }) } } </script>
效果:
注意:
接口数据语法参考mock.js