Registry / testing / vue-axios-client

vue-axios-client

JSON →
library0.2.2jsnpmunverified

A Vue.js plugin and AxiosRequest component that integrates Axios with Vue, providing a scoped-slot based API for async HTTP requests. The current stable version is 0.2.2. The package wraps the full Axios request lifecycle (loading, error, success) into a reusable component, reducing boilerplate for data fetching in Vue templates. It supports configurabe axios instances, lazy requests, pending delay, and transformData for response preprocessing. Compared to alternatives like vue-resource or vuex-axios, it offers a more declarative, template-oriented approach using slot props (data, isLoading, error). The library is lightweight, with no runtime dependencies beyond vue and axios, and it is released on a slow cadence (last update in 2018). Note that it only supports Vue 2 and is not compatible with Vue 3.

npm install vue-axios-client
INSTALL
IMPORT
SIG · VUE-AXIOS-CLIENT
V
vue-axios-client
testingjavascriptv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VueAxiosClient
import VueAxiosClient from 'vue-axios-client'
const VueAxiosClient = require('vue-axios-client')
Default export - note that this is a class, not a function; must be instantiated with 'new'.
AxiosRequest
import { AxiosRequest } from 'vue-axios-client'
import AxiosRequest from 'vue-axios-client'
Named export, not default. Common mistake to import it as default.
Vue
import Vue from 'vue'
import { Vue } from 'vue' or import Vue from 'vue' (for Vue 2)
Separate import required - Vue is not part of this package. For Vue 2 only.

Minimal Vue app using vue-axios-client to make a GET request and display the result.

const express = require('express'); const app = express(); app.get('/', (req, res) => res.send('Hello')); app.listen(3000);
Debug
Known issues
breakingv0.2.0 changed the API: VueAxiosClient is now a class that requires instantiation; previously it was a function.
fix
Use 'new VueAxiosClient({ axios })' instead of calling VueAxiosClient(axios).
affects: <0.2.0
breakingv0.1.0 renamed the component from 'AxiosRequest' to 'VueAxiosClient' and changed the plugin registration.
fix
Upgrade to >=0.1.0 and follow the new import/usage pattern.
affects: <0.1.0
gotchaThe package only supports Vue 2 (not Vue 3). Attempting to use with Vue 3 will throw errors.
fix
Use only with Vue 2 projects, or switch to an equivalent library for Vue 3 (e.g., vue-axios or vue-query).
affects: >=0.0.0
gotchaIf 'axios' prop is not provided to AxiosRequest, it uses the instance passed to VueAxiosClient during plugin installation. Forgetting to pass the axios instance can result in silent failures.
fix
Always pass the axios instance either globally via plugin options or locally via the 'axios' prop.
affects: >=0.0.0
deprecatedThe 'tag' prop with a falsy value to make the component renderless is deprecated; use a specific tag or none instead.
fix
Use a valid HTML tag name or omit the prop (defaults to 'div').
affects: >=0.2.0
Errors
Common errors & fixes
TypeError: VueAxiosClient is not a constructor
Using default import of VueAxiosClient incorrectly or using an outdated version where it was a function.
fix
Ensure you have version >=0.2.0 and use 'new VueAxiosClient({ axios })'.
Unknown custom element: <AxiosRequest> - did you register the component correctly?
The AxiosRequest component was not registered globally or locally in the Vue instance.
fix
Use 'Vue.component('AxiosRequest', AxiosRequest)' after importing it, or register it locally in your component's 'components' option.
Cannot find module 'vue-axios-client'
Package not installed or not resolved correctly.
fix
Run 'npm install vue-axios-client' and check that your bundler (webpack, rollup) can resolve node_modules.
Failed to mount component: template or render function not defined
Using Vue 3 with this plugin, which expects Vue 2.
fix
Switch to a Vue 3 compatible library, or downgrade to Vue 2.
Upgrade
Version history
0.2.2latest on npm
Audit
Dependencies
vuerequiredpeer dependency - the plugin works only with Vue 2
axiosrequiredpeer dependency - the underlying HTTP client
Agent activity
10 hits · last 30 days
node
8
Resources
vue-axios-client — npm install vue-axios-client · libregistry