Skip to content

Commit

Permalink
fix: fix config.productionTip
Browse files Browse the repository at this point in the history
fix #7565
  • Loading branch information
yyx990803 committed Jan 31, 2018
1 parent 4746256 commit ced00b1
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions src/platforms/web/runtime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'](

This comment has been minimized.

Copy link
@smalllong

smalllong Sep 2, 2019

According to MDN and caniuse, console.info has the same compatibility with console.log. How about replace it with a single console.info?

'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

0 comments on commit ced00b1

Please sign in to comment.