How to check the Vue Version Quickly
In this tutorial, we are going to learn about how to check the vue version currently we are using in our project.
Note: This tutorial assumes that you already created a new vue project using the vue-cli.
Using the Vue.version
We can use the Vue.version
property to check the current vue version during a runtime.
Example:
In your main.js
file add the following log
.
import Vue from 'vue'
import App from './App.vue'
console.log(Vue.version); // 2.6.11
new Vue({
render: h => h(App),
}).$mount('#app')
Using the terminal
Inside the terminal, you can check the vue version by running the following npm command.
npm list vue
Output:
vue@2.6.11
or you can view the vue version directly, inside your project by opening a package.json
file.
{
"name": "vue-todo",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.4",
"vue": "^2.6.11" },