From 6994b637431de3829a3412a615f690c659099135 Mon Sep 17 00:00:00 2001 From: Zhaolin Lau <68846168+zhaolinlau@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:15:53 +0800 Subject: [PATCH] Update useFetch and useAsyncData snippet Replace 'pending' with 'status' and add 'clear' function --- snippets/Nuxt/composables.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/Nuxt/composables.json b/snippets/Nuxt/composables.json index 8de1b7c..1a230ff 100644 --- a/snippets/Nuxt/composables.json +++ b/snippets/Nuxt/composables.json @@ -7,7 +7,7 @@ "useAsyncData": { "prefix": "useAsyncData", "body": [ - "const { data, pending, error, refresh } = await useAsyncData(", + "const { data, status, error, refresh, clear } = await useAsyncData(", " '$2',", " () => \\$fetch('$3')", ");" @@ -37,7 +37,7 @@ "useFetch": { "prefix": "useFetch", "body": [ - "const { data, pending, error, refresh } = await useFetch('$1',{", + "const { data, status, error, refresh, clear } = await useFetch('$1',{", " $2", "})" ],