Nuxt 3 reached end of life on 31 July 2026
It no longer receives bug fixes or security patches. Upgrade to Nuxt 4 or get extended support from HeroDevs

clearNuxtData

Source
Delete cached data, error status and pending promises of useAsyncData and useFetch.
This method is useful if you want to invalidate the data fetching for another page.

Type

Signature
export function clearNuxtData (keys?: string | string[] | ((key: string) => boolean)): void

Parameters

  • keys: One or an array of keys that are used in useAsyncData to delete their cached data. If no keys are provided, all data will be invalidated.