diff --git a/src/platforms/web/runtime/index.js b/src/platforms/web/runtime/index.js index 71fe444a19d..1283f521aaa 100644 --- a/src/platforms/web/runtime/index.js +++ b/src/platforms/web/runtime/index.js @@ -44,32 +44,34 @@ Vue.prototype.$mount = function ( // devtools global hook /* istanbul ignore next */ -Vue.nextTick(() => { - if (config.devtools) { - if (devtools) { - devtools.emit('init', Vue) - } else if ( - process.env.NODE_ENV !== 'production' && +if (inBrowser) { + setTimeout(() => { + if (config.devtools) { + if (devtools) { + devtools.emit('init', Vue) + } else if ( + process.env.NODE_ENV !== 'production' && + process.env.NODE_ENV !== 'test' && + isChrome + ) { + console[console.info ? 'info' : 'log']( + 'Download the Vue Devtools extension for a better development experience:\n' + + 'https://github.com/vuejs/vue-devtools' + ) + } + } + if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test' && - isChrome + config.productionTip !== false && + typeof console !== 'undefined' ) { console[console.info ? 'info' : 'log']( - 'Download the Vue Devtools extension for a better development experience:\n' + - 'https://github.com/vuejs/vue-devtools' + `You are running Vue in development mode.\n` + + `Make sure to turn on production mode when deploying for production.\n` + + `See more tips at https://vuejs.org/guide/deployment.html` ) } - } - if (process.env.NODE_ENV !== 'production' && - process.env.NODE_ENV !== 'test' && - config.productionTip !== false && - inBrowser && typeof console !== 'undefined' - ) { - console[console.info ? 'info' : 'log']( - `You are running Vue in development mode.\n` + - `Make sure to turn on production mode when deploying for production.\n` + - `See more tips at https://vuejs.org/guide/deployment.html` - ) - } -}, 0) + }, 0) +} export default Vue