- Install on Chrome
- Install on Firefox
- Install the standalone app
- How to use the Developer Tools
When you’re first experimenting with Vue, if you open the Browser Developer Tools you will find this message: “Download the Vue Devtools extension for a better development experience: https://github.com/vuejs/vue-devtools“
This is a friendly reminder to install the Vue Devtools Extension. What’s that? Any popular framework has its own devtools extension, which generally adds a new panel to the browser developer tools that is much more specialized than the ones that the browser ships by default. In this case, the panel will let us inspect our Vue application and interact with it.
This tool will be an amazing help when building Vue apps. The developer tools can only inspect a Vue application when it’s in development mode. This makes sure no one can use them to interact with your production app (and will make Vue more performant because it does not have to care about the devtools)
Let’s install it!
There are 3 ways to install the Vue Dev Tools:
- on Chrome
- on Firefox
- as a standalone application
Safari, Edge and other browsers are not supported with a custom extension, but using the standalone application you can debug a Vue.js app running in any browser.
Install on Chrome
Go to this page on the Google Chrome Store: https://chrome.google.com/webstore/detail/vuedevtools/nhdogjmejiglipccpnnnanhbledajbpd and click Add to Chrome.
Go through the installation process:
The Vue.js devtools icon shows up in the toolbar. If the page does not have a Vue.js instance running, it’s grayed out.
If Vue.js is detected, the icon has the Vue logo colors.
The icon does nothing except showing us that there is a Vue.js instance. To use the devtools, we must open the Developer Tools panel, using “View → Developer → Developer Tools”, or
Install on Firefox
You can find the Firefox dev tools extension in the Mozilla addons store: https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/
Click “Add to Firefox” and the extension will be installed. As with Chrome, a grayed icon shows up in the toolbar
And when you visit a site that has a Vue instance running, it will become green, and when we open the Dev Tools we will see a “Vue” panel:
Install the standalone app
Alternatively, you can use the DevTools standalone app.
Install it using
npm install -g @vue/devtools //or yarn global add @vue/devtools
and run it by calling
This will open the standalone Electron-based application.
now, paste the script tag it shows you:
inside the project
index.html file, and wait for the app to be reloaded, and it will automatically connect to the app:
How to use the Developer Tools
As mentioned, the Vue DevTools can be activated by opening the Developer Tools in the browser and moving to the Vue panel.
Another option is to right-click on any element in the page, and choose “Inspect Vue component”:
When the Vue DevTools panel is open, we can navigate the components tree. When we choose a component from the list on the left, the right panel shows the props and data it holds:
On the top there are 4 buttons:
- Components (the current panel), which lists all the component instances running in the current page. Vue can have multiple instances running at the same time, for example it might manage your shopping cart widget and the slideshow, with separate, lightweight apps.
- Vuex is where you can inspect the state managed through Vuex.
- Events shows all the events emitted
- Refresh reloads the devtools panel
Notice the small
= $vm0 text beside a component? It’s a handy way to inspect a component using the Console. Pressing the “esc” key shows up the console in the bottom of the devtools, and you can type
$vm0 to access the Vue component:
This is very cool to inspect and interact with components without having to assign them to a global variable in the code.
Start typing a component name, and the components tree will filter out the ones that don’t match.
Select component in the page
button and you can hover any component in the page with the mouse, click it, and it will be opened in the devtools.
Format components names
You can choose to show components in camelCase or use dashes.
Filter inspected data
On the right panel, you can type any word to filter the properties that don’t match it.
Click the Inspect DOM button to be brought to the DevTools Elements inspector, with the DOM element generated by the component:
Open in editor
Any user component (not framework-level components) has a button that opens it in your default editor. Very handy.
Download my free Vue Handbook
More vue tutorials:
- An overview of Vue.js
- The Vue.js CLI: learn how to use it
- The Vue.js DevTools
- Configuring VS Code for Vue Development
- Create your first app with Vue.js
- Vue.js Single File Components
- Vue.js templates and interpolations
- Vue.js Directives
- Vue.js Methods
- Vue.js Computed Properties
- Styling Vue.js components using CSS
- Vue.js Watchers
- Vue methods vs watchers vs computed properties
- Vue.js Filters
- Vue.js Components
- Vue.js Slots
- Vue.js Component Props
- Vue.js Events
- Vue.js Components Communication
- Vuex, the Vue.js State Manager
- Vue, use a component inside another component
- Vue, how to use a prop as the class name
- How to use SCSS with Vue.js Single File Components
- Using Tailwind with Vue.js
- The Vue Router
- Dynamically show a Vue component
- The Vue.js Cheat Sheet
- Store Vue data to localStorage using Vuex
- How to dynamically apply a class using Vue
- Vue, how to use v-model
- Vue, why data must be a function
- Roadmap to become a Vue.js developer in 2020