Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6ae1d91

Browse files
committedJan 6, 2020
perf: refine
1 parent 81db6b8 commit 6ae1d91

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/main.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ import * as filters from './filters' // global filters
2424
* you want to use MockJs for mock api
2525
* you can execute: mockXHR()
2626
*
27+
* Currently MockJs will be used in the production environment,
28+
* please remove it before going online ! ! !
2729
*/
2830
if (process.env.NODE_ENV === 'production') {
29-
const { mockXHR } = require('../mock').default
30-
mockXHR()
31+
import('../mock').then(({ mockXHR }) => {
32+
mockXHR()
33+
})
3134
}
3235

3336
Vue.use(Element, {

0 commit comments

Comments
 (0)
Please sign in to comment.