我几乎在各个方面都喜欢Vue,但是每当我启动Vue应用程序时都会记录下来:
Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools
我希望拥有最少的开发经验,并且不需要此Vue扩展。我想禁用我发现烦人的提示。我该怎么办?
在查看Vue的源代码时,提示记录如下:
if (inBrowser) {
setTimeout(function () {
if (config.devtools) {
if (devtools) {
devtools.emit('init', Vue);
} else if (
true
) {
console[console.info ? 'info' : 'log'](
'Download the Vue Devtools extension for a better development experience:\n' +
'https://github.com/vuejs/vue-devtools'
);
}
}
if ( true &&
config.productionTip !== false &&
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);
}
与development mode
在Vue.config.productionTip = false
之前可以关闭的类似new Vue({...})
警告相反,似乎没有基于配置的转义来防止提示被记录。因此,我有以下选择,这些选择并不完全使我满意:
console.log
以过滤掉此特定消息→不是“ The Vue Way”