Vue DevTools Documentation
repository·main·Indexed 25 days ago
https://github.com/vuejs/devtoolsA suite of developer tools for Vue.js applications providing inspection and debugging capabilities. Version 7+ supports Vue 3 and is available as a Vite plugin, a standalone application (@vue/devtools), or browser extensions for Chrome and Firefox. Key features include component tree inspection, state editing, time travel debugging, and integrations with Pinia and Vue Router.
What's inside Vue DevTools
- The Vue DevTools browser extension is a tool for inspecting and debugging Vue applications. Note that this extension is currently still under development.
Overview of Vue DevTools features
mainVue DevTools is a developer tool designed to enhance productivity and debugging for Vue.js applications. Key capabilities include:
- Live Editing Properties: Edit component properties directly in the tool to see immediate changes in the application without code restarts.
- Time Travel Debugging: Inspect application state at specific points in time to track state changes and debug logic.
- Vue Router Integration: Inspect the list of routes and their specific details.
- Pinia Integration: Monitor and track custom events, including the source component, name, size, and payload, to identify performance bottlenecks.
- Comprehensive Inspection: General inspection of the Vue application structure and state.
Overview of DevTools Client
mainThe@vue/devtools-clientpackage provides the client-side implementation for interacting with Vue DevTools. It serves as the bridge between the application being inspected and the DevTools interface.Use @vue/devtools as a standalone application
mainThe@vue/devtoolspackage provides a standalone Vue DevTools application. This allows you to debug any Vue application regardless of the environment, including mobile browsers, Safari, or native scripts, extending debugging capabilities beyond standard desktop Chrome or Firefox extensions.Explore Vue DevTools core features
mainVue DevTools provides several tabs for inspecting your application:
- Overview: Displays a summary of your app, including the current Vue version, pages, and components.
- Pages: Shows current routes and provides navigation between them. Includes a textbox to test route matching.
- Components: Displays the component node tree, state information, and interactive tools like editing state or scrolling to a component.
- Timeline: Monitors application performance, specifically time spent on rendering and updating.
- Router: Integrated with
vue-routerto view route lists and specific route details. - Pinia: Integrated with
piniato view store lists, inspect details, and edit state. - Graph: Visualizes the relationships between different modules.
- Settings: Provides configuration options to customize the DevTools experience.
Use @vue/devtools-api for DevTools integrations
main@vue/devtools-api is a plugin API designed to facilitate easier integrations with Vue DevTools. To build integrations or plugins that interact with the DevTools ecosystem, you should refer to the official documentation for detailed implementation guides.Get started with standalone @vue/devtools
mainTo set up and use the standalone version of Vue DevTools for debugging applications in environments like mobile browsers or native scripts, follow the official guide at devtools.vuejs.org.Configure the Vite plugin for Vue DevTools
mainAdd
vueDevTools()to thepluginsarray in yourvite.config.tsfile to enable DevTools in your project.import { defineConfig } from 'vite' import vueDevTools from 'vite-plugin-vue-devtools' export default defineConfig({ plugins: [ vueDevTools(), ], })Enable Split Screen mode
mainSplit Screen allows you to view and interact with multiple DevTools tabs simultaneously. You can activate this mode in two ways:
- Open the Command Palette (
Ctrl+K/Cmd+K) and select the split screen option. - Click the Vue Icon in the top left corner of the DevTools and select the split screen option from the menu.
- Open the Command Palette (
Select the correct Vue DevTools version for Vue 2 or Vue 3
mainThe version of Vue DevTools you should use depends on your application's Vue version:
- Vue 3: Use v7 (the current version).
- Vue 2: Use v6. You can install it from the Chrome Web Store.
- Legacy/Older Vue 2: Use v5. You can install it here.
Set up the Vue DevTools development environment
mainTo set up the local development environment, ensure you have the following prerequisites installed:
- Node.js: version 18.19 or higher
- PNPM: version 10 or higher
After cloning the repository, install the project dependencies using:
pnpm iMigrate plugins to v7
mainWhen migrating plugins from v6 to v7:
- API Compatibility: The v7 version is fully compatible with the v6 Plugin API, with the exception of TypeScript types.
- Timeline Tab: The Plugin Timeline tab has been moved. It is now managed within each individual plugin's menu rather than being a top-level tab.