nuxt-custom-fetch 4.0.0-alpha.1 → 4.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime/ajax.js +2 -1
- package/package.json +1 -1
package/dist/runtime/ajax.js
CHANGED
|
@@ -135,6 +135,7 @@ export class CustomFetch {
|
|
|
135
135
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : {};
|
|
136
136
|
if (import.meta.client) {
|
|
137
137
|
const _ref = options.deep ? ref : shallowRef;
|
|
138
|
+
options.default ??= () => asyncDataDefaults.value;
|
|
138
139
|
const asyncData = {
|
|
139
140
|
data: _ref(null),
|
|
140
141
|
error: _ref(null),
|
|
@@ -167,7 +168,7 @@ export class CustomFetch {
|
|
|
167
168
|
return asyncData;
|
|
168
169
|
}).catch((error) => {
|
|
169
170
|
asyncData.error.value = createError(error);
|
|
170
|
-
asyncData.data.value = unref(options
|
|
171
|
+
asyncData.data.value = unref(options.default());
|
|
171
172
|
asyncData.status.value = "error";
|
|
172
173
|
return asyncData;
|
|
173
174
|
}).finally(() => {
|