vue-cli-mock
v1.1.0
Published
A quick build mock plug-in based on vue-cli3
Downloads
34
Readme
vue-cli-mock
安装
npm install vue-cli-mock -S
使用
vue.config.js
const mock = require('vue-cli-mock')
module.exports = {
devServer: {
before (app) {
mock(app, 'mock')
}
}
}
根目录下 mock/user.js
module.exports = {
'GET /user/login': (req, res) => {
res.json({ custom: '1111' })
},
'/user/1': (req, res) => {
res.json({ custom: 'response' })
},
'/dicts': {
status: [1, 2, 3]
}
}