-
Notifications
You must be signed in to change notification settings - Fork 67
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
1 parent
ae7b9d1
commit 1864393
Showing
5 changed files
with
52 additions
and
18 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
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,40 @@ | ||
<script setup lang="ts"> | ||
import { ref, watch } from "vue"; | ||
import { useAppStore } from "~/store/app"; | ||
import { storeToRefs } from "pinia"; | ||
import { ElLoading } from "element-plus"; | ||
let appStore = useAppStore(); | ||
const { loading, loadingText } = storeToRefs(appStore); | ||
//全局loading动画 | ||
let loadingDom: any = null; | ||
watch( | ||
() => loading.value, | ||
(value, oldValue) => { | ||
if (loading.value) { | ||
loadingDom = ElLoading.service({ | ||
lock: true, | ||
text: loadingText.value, | ||
background: "rgba(255, 255, 255, 0.8)", | ||
}); | ||
} else { | ||
try { | ||
loadingDom.close(); | ||
} catch (error) {} | ||
} | ||
}, | ||
{ immediate: true } | ||
); | ||
watch( | ||
() => loadingText.value, | ||
(value, oldValue) => { | ||
try { | ||
loadingDom.setText(value); | ||
} catch (error) {} | ||
}, | ||
{ immediate: true } | ||
); | ||
</script> | ||
|
||
<template></template> | ||
|
||
<style></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
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