-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
<script setup> | ||
import 'primeicons/primeicons.css' | ||
import { computed } from 'vue' | ||
import { useLoadingStore } from "@/store/loading"; | ||
import Icon from "@/components/Icon.vue"; | ||
const loadingStore = useLoadingStore(); | ||
const isLoading = computed(() => loadingStore.isLoading); | ||
</script> | ||
|
||
<template> | ||
<div v-if="isLoading" class="bg-white/80 fixed top-0 left-0 z-[1000] h-screen w-full flex justify-center items-center"> | ||
<Icon icon="pi-spin pi-spinner" className="text-3xl text-[#67c23a]"/> | ||
</div> | ||
<router-view></router-view> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import AxiosClient from "./axios"; | ||
|
||
const resource = "/category"; | ||
|
||
export default { | ||
get(classId: string) { | ||
return AxiosClient.get(`${resource}/${classId}/exams`); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { defineStore } from 'pinia'; | ||
|
||
interface LoadingState { | ||
isLoading: boolean; | ||
}; | ||
|
||
export const useLoadingStore = defineStore({ | ||
id: "loading", | ||
|
||
state: ():LoadingState => ({ | ||
isLoading: false, | ||
}), | ||
|
||
getters: { | ||
|
||
}, | ||
|
||
actions: { | ||
changeLoadingState(_isLoading: boolean) { | ||
this.isLoading = _isLoading; | ||
if (_isLoading) { | ||
document.body.style.overflowY = "hidden"; | ||
} else { | ||
document.body.style.overflowY = "scroll"; | ||
} | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters