vue.js - 在哪里插入Vue.productionTip = false 以摆脱vue开发模式警告
问题描述
当谈到 js 时,我是一个完全的新手,我所要做的就是插入该行以关闭消息,但无论我把它放在哪里,消息都会保留。我的代码是
var getCalculatorApp = (function () {
var initialize = function () {
new Vue({
el: "#content",
data: {
region: "England"
} //then others stuff and methods
});
}
return {
initialize: initialize
};
})
解决方案
您可以将其添加到您的顶部getCalculatorApp
var getCalculatorApp = (function () {
Vue.productionTip = false
var initialize = function () {
new Vue({
el: "#content",
data: {
region: "England"
} //then others stuff and methods
});
}
return {
initialize: initialize
};
})
但是要关闭警告,您很可能需要进行生产构建,并且该标志不会改变它。
推荐阅读
- python - 匹配列熊猫数据框
- javascript - 如何将redux添加到同一个文件中的两个功能组件?
- javascript - RN Expo:创建用户并保存到 Firestore 工作得很好,确保没有其他人在注册时创建用户名的最佳方法是什么?
- ios - 如何在本机反应中左对齐导航标题中的标题?
- javascript - 按多个条件过滤数组
- physics - GODOT 实时更新重力
- c# - c# Unity - 如何在另一个类中调用结构对象数组
- docker - Kafka 通过 AWS privatelink 广告监听器
- windows - Klist windows server 命令缓存票证
- reactjs - 如何通过 Serial 在 React CRA 网站和 Arduino 之间进行通信