You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:如何消除页面加载时的Vue开发模式提示

Solution to Suppress Vue Development Mode Warning

Yep, the solution you mentioned—adding Vue.config.productionTip = false to your app.js file—is totally valid and will get rid of that annoying development mode prompt every time you load the page.

This configuration flag is an official Vue setting that explicitly tells the framework to skip displaying that production mode reminder in the browser console. It’s a quick, non-intrusive fix that doesn’t affect any other part of your application’s functionality.

Here’s how to implement it properly:

  • Open your main app.js file (or the primary entry point of your Vue app)
  • Add the line before you initialize your Vue instance with new Vue({ ... })
  • Example code snippet:
// app.js (Vue 2)
import Vue from 'vue'
import App from './App.vue'

// Disable the production tip warning
Vue.config.productionTip = false

new Vue({
  render: h => h(App)
}).$mount('#app')

For Vue 3 users:

If you’re working with Vue 3, the syntax is a bit different since we use createApp instead of the global Vue object. You can set the flag directly on the app instance:

// main.js (Vue 3)
import { createApp } from 'vue'
import App from './App.vue'

const app = createApp(App)
// Turn off the production tip
app.config.productionTip = false
app.mount('#app')

A quick side note: When you build your app for production (using commands like npm run build), Vue automatically switches to production mode by default. This flag just hides the reminder during development so you don’t have to see that message every time you refresh the page.

内容的提问来源于stack exchange,提问作者dahrina

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 10:27:34