禁用“开发模式"VueJS 中的警告 [英] Disable "development mode" warning in VueJS

查看:52
本文介绍了禁用“开发模式"VueJS 中的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发模式下运行 Vue,每次加载页面时都会收到此消息:

I'm running Vue in development mode, and I get this message every time I load the page:

"您正在以开发模式运行 Vue.请确保打开为生产部署时的生产模式.查看更多提示,请访问https://vuejs.org/guide/deployment.html"

"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"

有没有办法在不切换到生产模式的情况下禁用它?

Is there a way to disable it without switching to production mode?

推荐答案

从 Vue.JS 2.2.0 开始,开发警告可以如下禁用:

As of Vue.JS 2.2.0 the development warning can be disabled as follows:

Vue.config.productionTip = false

应该添加到 main.js(或 main.ts,如果使用 TypeScript)

should be added to main.js (or main.ts if using TypeScript)

这篇关于禁用“开发模式"VueJS 中的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆