@@ -88,26 +88,26 @@ import { ref } from 'vue';
8888const id = ref(1);
8989
9090// Function without arguments
91- const { data: dataList, pending: listPending , error: listError } = wrappedService.fetchData();
91+ const { data: dataList, status: listStatus , error: listError } = wrappedService.fetchData();
9292
9393// Function with arguments
94- const { data: itemData, pending: itemPending , error: itemError } = wrappedService.getItem(() => [id.value]);
94+ const { data: itemData, status: itemStatus , error: itemError } = wrappedService.getItem(() => [id.value]);
9595
9696// Reactivity: when id.value changes, itemData updates automatically
9797</script>
9898
9999<template>
100100 <div>
101101 <h1>Data List</h1>
102- <div v-if="listPending ">Loading...</div>
102+ <div v-if="listStatus === 'pending' ">Loading...</div>
103103 <div v-else-if="listError">Error: {{ listError.message }}</div>
104104 <div v-else>
105105 <pre>{{ dataList }}</pre>
106106 </div>
107107
108108 <h1>Item Data (ID: {{ id }})</h1>
109109 <input v-model="id" type="number" min="1" />
110- <div v-if="itemPending ">Loading...</div>
110+ <div v-if="itemStatus === 'pending' ">Loading...</div>
111111 <div v-else-if="itemError">Error: {{ itemError.message }}</div>
112112 <div v-else>
113113 <pre>{{ itemData }}</pre>
@@ -160,7 +160,7 @@ async function fetchData() {
160160const wrappedService = useAsyncDataWrapper ({ fetchData });
161161
162162// Use in a component
163- const { data, pending , error } = wrappedService .fetchData ();
163+ const { data, status , error } = wrappedService .fetchData ();
164164```
165165
166166### Function With Arguments
@@ -179,7 +179,7 @@ import { ref } from 'vue';
179179
180180const id = ref (1 );
181181
182- const { data, pending , error } = wrappedService .getItem (() => [id .value ]);
182+ const { data, status , error } = wrappedService .getItem (() => [id .value ]);
183183
184184// When id.value changes, data is automatically refreshed
185185```
@@ -193,7 +193,7 @@ You can pass options to `useAsyncData` through the wrapped functions to control
193193### Example with Options
194194
195195``` typescript
196- const { data, pending , error } = wrappedService .fetchData ({
196+ const { data, status , error } = wrappedService .fetchData ({
197197 lazy: true ,
198198 server: false ,
199199 default : () => [],
0 commit comments