Skip to content

Commit 6056378

Browse files
yyx990803hefeng
authored and
hefeng
committed
fix: fix config.productionTip
fix vuejs#7565
1 parent bcbc2e8 commit 6056378

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

src/platforms/web/runtime/index.js

+24-22
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,34 @@ Vue.prototype.$mount = function (
4444

4545
// devtools global hook
4646
/* istanbul ignore next */
47-
Vue.nextTick(() => {
48-
if (config.devtools) {
49-
if (devtools) {
50-
devtools.emit('init', Vue)
51-
} else if (
52-
process.env.NODE_ENV !== 'production' &&
47+
if (inBrowser) {
48+
setTimeout(() => {
49+
if (config.devtools) {
50+
if (devtools) {
51+
devtools.emit('init', Vue)
52+
} else if (
53+
process.env.NODE_ENV !== 'production' &&
54+
process.env.NODE_ENV !== 'test' &&
55+
isChrome
56+
) {
57+
console[console.info ? 'info' : 'log'](
58+
'Download the Vue Devtools extension for a better development experience:\n' +
59+
'https://github.com/vuejs/vue-devtools'
60+
)
61+
}
62+
}
63+
if (process.env.NODE_ENV !== 'production' &&
5364
process.env.NODE_ENV !== 'test' &&
54-
isChrome
65+
config.productionTip !== false &&
66+
typeof console !== 'undefined'
5567
) {
5668
console[console.info ? 'info' : 'log'](
57-
'Download the Vue Devtools extension for a better development experience:\n' +
58-
'https://github.com/vuejs/vue-devtools'
69+
`You are running Vue in development mode.\n` +
70+
`Make sure to turn on production mode when deploying for production.\n` +
71+
`See more tips at https://vuejs.org/guide/deployment.html`
5972
)
6073
}
61-
}
62-
if (process.env.NODE_ENV !== 'production' &&
63-
process.env.NODE_ENV !== 'test' &&
64-
config.productionTip !== false &&
65-
inBrowser && typeof console !== 'undefined'
66-
) {
67-
console[console.info ? 'info' : 'log'](
68-
`You are running Vue in development mode.\n` +
69-
`Make sure to turn on production mode when deploying for production.\n` +
70-
`See more tips at https://vuejs.org/guide/deployment.html`
71-
)
72-
}
73-
}, 0)
74+
}, 0)
75+
}
7476

7577
export default Vue

0 commit comments

Comments
 (0)