Skip to content

Commit

Permalink
chore: use mockjs in production environment
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen committed May 10, 2019
1 parent 0bf339b commit 4ef0782
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ import * as filters from './filters' // global filters

/**
* If you don't want to use mock-server
* you want to use mockjs for request interception
* you can execute:
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* import { mockXHR } from '../mock'
* mockXHR()
* Currently MockJs will be used in the production environment,
* please remove it before going online! ! !
*/
import { mockXHR } from '../mock'
if (process.env.NODE_ENV === 'production') {
mockXHR()
}

Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size
Expand Down

0 comments on commit 4ef0782

Please sign in to comment.