แก้ไข loader

This commit is contained in:
Thanit Konmek 2023-08-04 10:04:59 +07:00
parent f072224851
commit b663eedb09
147 changed files with 3095 additions and 3256 deletions

View file

@ -113,7 +113,7 @@ import { onMounted, ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
const props = defineProps({
@ -129,9 +129,8 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { messageError, date2Thai } = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
const fullName = ref<string>("");
const examNumber = ref<string>("");
const citizenId = ref<string>("");
@ -152,7 +151,7 @@ onMounted(async () => {
});
const fetchCard = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateCard(props.candidateId))
.then((res) => {
@ -194,7 +193,7 @@ const fetchCard = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
</script>