sposchedule
53 строки · 911.0 Байт
1<script setup>
2import { computed } from 'vue';
3import { useLoadingStore } from '../stores/loading';
4
5const loadingStore = useLoadingStore();
6const isLoading = computed(() => loadingStore.isLoading);
7</script>
8
9<template>
10<div v-if="isLoading" class="loading-bar">
11<div class="loading-progress" />
12</div>
13</template>
14
15<style scoped>
16.loading-bar {
17position: fixed;
18top: 0;
19left: 0;
20width: 100%;
21height: 2px;
22/* background: rgba(255, 0, 0, 0.212); */
23display: flex;
24align-items: center;
25justify-content: flex-start;
26z-index: 5000;
27}
28
29.loading-progress {
30height: 100%;
31background-color: #007bff;
32animation: loading 2s infinite;
33}
34
35@keyframes loading {
360% {
37width: 0%;
38}
39
4050% {
41width: 50%;
42}
43
44100% {
45width: 100%;
46}
47}
48
49.loading-time {
50margin-left: 10px;
51font-size: 12px;
52}
53</style>
54