A simplified fetch API integration for Vue 3 applications that provides observable fetch calls with automatic loading, error, and data state management for components. Current stable version is 3.0.0 (released Jan 2023, updated quarterly). It requires Vue ^3.2.45 and ships TypeScript declarations. Unlike alternatives like vue-apollo or vue-query, vue-fetch is lightweight (no GraphQL or caching layer) and focuses on bare-minimum fetch binding with a composition API `useFetch` function, making it ideal for simple CRUD apps or API wrappers without extra overhead.
npm install vue-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the plugin globally with base URL and headers, then uses useFetch in a composition API setup to fetch data.
Migrate to v3 by installing vue@^3 and using `import { useFetch } from 'vue-fetch'` instead of `this.$fetch`.Replace `createResource` calls with direct `useFetch` calls, or wrap logic manually.
Use a ref for the URL if you want to react to changes: `const url = ref('/items'); useFetch(url)`.Always use absolute paths like `/items` in useFetch calls, not `items`.
Parse or handle errors as strings, or use try-catch around execute().
Use 'import { useFetch } from 'vue-fetch'' or set 'type':'module' in package.json.Use application-level plugin and import useFetch in components instead.
Ensure app.use(VueFetchPlugin) is called before any component uses useFetch.