我几乎在每个方面都喜欢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);
}与Vue.config.productionTip = false可以在new Vue({...})之前关闭的类似的new Vue({...})警告相反,似乎没有基于配置的转义来阻止记录提示。因此,我有以下几种选择,不能完全满足我的要求:
console.log,以过滤掉这条特定的消息--→而不是“Vue Way”发布于 2019-03-01 15:43:33
从您提供的源代码中,您是否在new Vue({...})之前尝试过以下操作
Vue.config.devtools = false发布于 2019-08-13 05:09:20
在chrome中,如果您右键单击其中一条消息并选择隐藏,它将被丢弃在您的过滤器中,因此不要再从vue.runtime.esm.js获得消息了:

发布于 2022-04-07 05:32:35
我们必须将--代码--放在"Vue javascript“的末尾
Vue.config.devtools = false;示例
let demo = new Vue({
data: {},
< Some code ...... >
});
Vue.config.devtools = false;附注:将这段代码放在"Vue.config.devtools = false;“在程序头上将不起作用。
https://stackoverflow.com/questions/54947888
复制相似问题