/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online ! ! !
*/
// if (process.env.NODE_ENV === 'production') {
// const { mockXHR } = require('../mock')
// mockXHR()
// }
3条答案
按热度按时间wrrgggsh1#
请看注释啊!!!
呃......好吧
我来告诉你
vue.config.js
before: require('./mock/mock-server.js')
如果不需要mock,直接删除或注释; 然后你在main.js 把 mock代码块删除或注释.然后,你就可以愉悦的开发了。。。
hjqgdpho2#
同问,代码和文档不匹配了
w80xi6nr3#
before: require('./mock/mock-server.js')
请教下,我记得文档里说可以逐步替换mock接口的,这怎么做到的