vue.js - 如何关闭来自 Nuxt 服务器的 console.info 消息?
问题描述
我正在运行测试并console.info
在终端中收到不必要的文本,我想摆脱:
console.info
Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools
at node_modules/vue/dist/vue.common.dev.js:9051:47
console.info
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
at node_modules/vue/dist/vue.common.dev.js:9060:45
const { Nuxt } = require('nuxt')
const nuxtConfig = require('../../../../nuxt.config.js')
let nuxt = null
beforeAll(async () => {
nuxt = new Nuxt({
...nuxtConfig,
buildDir: constants.buildDir
})
await nuxt.server.listen(constants.port, 'localhost')
}, 300000)
我尝试将 vue.config 静默属性放在上面代码中的各个位置,但也放入nuxt.config.js
,但这样做没有运气。我试过这个片段:https ://nuxtjs.org/docs/2.x/configuration-glossary/configuration-vue-config/
export default {
vue: {
config: {
productionTip: true,
devtools: false
}
}
}
如何关闭console.info
消息?
解决方案
您可以右键单击 devtools 控制台中的消息并使用Hide messages from vue.runtime.esm.js
. 由于过滤器,它将从您的控制台中隐藏它。不要解决真正的问题,而是一个很好的快速解决方案。
推荐阅读
- visual-studio - 打开 VS 2019 社区版
- vue.js - 为什么 Vue 无法识别 v-html 属性中使用的数据成员?
- javascript - 我正在尝试用 Javascript 制作计算器。但它不工作
- java - 使用 maven-compiler-plugin 从编译中排除 src/main/java
- jenkins - ZAP 扫描:Jenkins 作业失败 (url_not_in_context)
- c# - EF Core 自定义复杂约束
- javascript - React-native 复选框逻辑
- flutter - Flutter Create Dropdown 月/年选择器
- javascript - 文件、javascript、xml、对象FormData的链接问题
- scala - Scala Spark 处理带逗号的单引号字符