A small wrapper for integrating Axios into Vue.js applications. Current stable version is 3.5.2. It binds Axios to the Vue instance so you don't have to import Axios in every component. Supports both Vue 2 and Vue 3. Provides multiple registration names and support for multiple Axios instances. Ships TypeScript definitions. Release cadence is low; last release was in 2022. Key differentiator: simple migration path from vue-resource or manual Axios imports by exposing Axios globally via Vue.prototype (Vue 2) or app.config.globalProperties (Vue 3).
npm install vue-axiosNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Integrate Axios into Vue 3 using vue-axios plugin, with Options API and Composition API usage.
Use app.use(VueAxios, axios) and app.provide('axios', app.config.globalProperties.axios) for Composition API. See README examples.Use provide/inject in main.ts: app.provide('axios', app.config.globalProperties.axios) and inject('axios') in setup().Migrate to Vue 3, or continue using vue-axios 2.x for Vue 2 support (check compatibility).
Use provide/inject pattern: app.provide('axios', app.config.globalProperties.axios) in main.js, then inject('axios') in setup.Use import { createApp } from 'vue'; const app = createApp(App); app.use(VueAxios, axios);Install @types/vue-axios or use // @ts-ignore. Alternatively, use import VueAxios = require('vue-axios') with esModuleInterop: true.