Home > Article > Web Front-end > How to remove the vue logo
Vue is a front-end JavaScript framework that provides features such as componentization, data binding, and virtual DOM, allowing developers to build modern applications faster and easier. When using Vue, you may find a small Vue icon in the upper left corner of the page. So how to remove this logo?
Let’s introduce some methods below.
Pass in an option productionTip
in the Vue constructor and set it to false
, you can close the Vue prompt.
new Vue({ productionTip: false })
You can set an options object when instantiating the Vue object, and the properties of the objectproductionTip
are set is false.
new Vue({ el: '#app', productionTip: false })
We can set an options object in Vue’s global configuration to turn off the Vue prompt. For example:
Vue.config.productionTip = false
If you don’t want to use the above method, you can also modify the source code of Vue to remove this small icon.
Open the node_modules/vue/dist/vue.js
file and find the following code segment:
function initVue (Vue) { const version = Number(Vue.version.split('.')[0]) if (version >= 2) { // Vue 2.x Vue.mixin({ beforeCreate: vuexInit }) } else { // Vue 1.x const _init = Vue.prototype._init Vue.prototype._init = function (options) { options = options || {} options.init = options.init ? [vuexInit].concat(options.init) : vuexInit _init.call(this, options) } } // 忽略这个图标的数据 Vue.config.productionTip = false } initVue(Vue)
Change the last line of Vue.config.productionTip = true
Modify to Vue.config.productionTip = false
.
After completing the modification, repackage your Vue project.
In short, the methods introduced above can help you remove the Vue logo. Hope this article can help you.
The above is the detailed content of How to remove the vue logo. For more information, please follow other related articles on the PHP Chinese website!