@anweb/nuxt-ancore 1.15.6 → 1.15.7
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/module.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, watch, onMounted } from "vue";
|
|
1
|
+
import { computed, ref, watch, onMounted, nextTick } from "vue";
|
|
2
2
|
import { useAsyncData } from "#app";
|
|
3
3
|
import { toQuery, userApi } from "../utils/index.js";
|
|
4
4
|
export const useAnData = (initConfig) => {
|
|
@@ -16,8 +16,10 @@ export const useAnData = (initConfig) => {
|
|
|
16
16
|
path.value.url,
|
|
17
17
|
{ method: "GET", ...config.value.apiConfig || {} }
|
|
18
18
|
).then((response) => {
|
|
19
|
-
status.value = "success";
|
|
20
19
|
data.value = response;
|
|
20
|
+
nextTick().then(() => {
|
|
21
|
+
status.value = "success";
|
|
22
|
+
});
|
|
21
23
|
}).catch((e) => {
|
|
22
24
|
status.value = "error";
|
|
23
25
|
error.value = e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, reactive, watch, computed
|
|
1
|
+
import { ref, reactive, watch, computed } from "vue";
|
|
2
2
|
import { useInfiniteScroll } from "@vueuse/core";
|
|
3
3
|
import { useAnData } from "./useAnData.js";
|
|
4
4
|
export const useAnList = (initConfig) => {
|
|
@@ -10,7 +10,7 @@ export const useAnList = (initConfig) => {
|
|
|
10
10
|
await data.init();
|
|
11
11
|
await refresh();
|
|
12
12
|
};
|
|
13
|
-
const refresh =
|
|
13
|
+
const refresh = () => {
|
|
14
14
|
if (!data.data.value) return;
|
|
15
15
|
if (!config.value.apiConfig?.query?.[config.value.skipField || "skip"]) {
|
|
16
16
|
setCount(null);
|
|
@@ -22,7 +22,6 @@ export const useAnList = (initConfig) => {
|
|
|
22
22
|
items.push(...data.data.value.items);
|
|
23
23
|
}
|
|
24
24
|
setCount(data.data.value.count);
|
|
25
|
-
await nextTick();
|
|
26
25
|
};
|
|
27
26
|
const setCount = (value) => {
|
|
28
27
|
count.value = value;
|