yarn add mockjs 安装mock
import Mock from 'mockjs' Mock.mock('/api', 'get', { code: 200, message: '成功!' })
随后在main.js 引入即可