vueless 0.0.688 → 0.0.689
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/package.json
CHANGED
|
@@ -16,7 +16,7 @@ defineOptions({ inheritAttrs: false });
|
|
|
16
16
|
|
|
17
17
|
const props = withDefaults(defineProps<Props>(), {
|
|
18
18
|
...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
|
|
19
|
-
resources: () =>
|
|
19
|
+
resources: () => "",
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
const error = ref(false);
|
|
@@ -46,15 +46,15 @@ const barStyle = computed(() => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const resourceNamesArray = computed(() => {
|
|
49
|
-
if (!props.resources) {
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
49
|
return Array.isArray(props.resources)
|
|
54
50
|
? props.resources.map(getRequestWithoutQuery)
|
|
55
51
|
: [getRequestWithoutQuery(props.resources)];
|
|
56
52
|
});
|
|
57
53
|
|
|
54
|
+
const isPropsLoading = computed(
|
|
55
|
+
() => requestQueue.value.includes(INFINITY_LOADING) && props.loading,
|
|
56
|
+
);
|
|
57
|
+
|
|
58
58
|
watch(() => requestQueue.value.length, onChangeRequestsQueue);
|
|
59
59
|
|
|
60
60
|
onMounted(() => {
|
|
@@ -98,7 +98,7 @@ function setLoaderOffHandler(event: CustomEvent<{ resource: string }>) {
|
|
|
98
98
|
|
|
99
99
|
function onChangeRequestsQueue() {
|
|
100
100
|
const isActiveRequests =
|
|
101
|
-
|
|
101
|
+
isPropsLoading.value ||
|
|
102
102
|
resourceNamesArray.value.some((resource: string) => {
|
|
103
103
|
return requestQueue.value.includes(resource);
|
|
104
104
|
});
|
|
@@ -3,7 +3,6 @@ import { inject, readonly, ref } from "vue";
|
|
|
3
3
|
import type { Ref } from "vue";
|
|
4
4
|
|
|
5
5
|
import { getRequestWithoutQuery } from "./utilLoaderProgress.ts";
|
|
6
|
-
import { INFINITY_LOADING } from "./constants.ts";
|
|
7
6
|
|
|
8
7
|
export const LoaderProgressSymbol = Symbol.for("vueless:loader-progress");
|
|
9
8
|
|
|
@@ -51,9 +50,7 @@ function removeRequestUrl(url: string | string[]): void {
|
|
|
51
50
|
if (Array.isArray(url)) {
|
|
52
51
|
url.map(getRequestWithoutQuery).forEach(removeRequestUrl);
|
|
53
52
|
} else {
|
|
54
|
-
requestQueue.value = requestQueue.value.filter(
|
|
55
|
-
(item) => item !== getRequestWithoutQuery(url) && item !== INFINITY_LOADING,
|
|
56
|
-
);
|
|
53
|
+
requestQueue.value = requestQueue.value.filter((item) => item !== getRequestWithoutQuery(url));
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
56
|
|