forked from vuejs/vue-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgressScreen.vue
117 lines (101 loc) · 2.25 KB
/
ProgressScreen.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<template>
<transition name="vue-ui-fade">
<div
v-if="progress"
class="loading-screen"
:class="{
loading
}"
>
<VueLoadingIndicator
class="primary big overlay fixed"
>
<div class="content">
<div v-if="progress.error" class="error">
<VueIcon
icon="error"
class="huge"
/>
<div>{{ progress.error }}</div>
<div class="actions">
<VueButton
icon-left="close"
:label="$t('components.progress-screen.close')"
@click="close()"
/>
</div>
</div>
<template v-else>
<div v-if="statusMessage" class="status">
{{ statusMessage }}
</div>
<div class="secondary-info">
<div v-if="progress.info" class="info">
{{ progress.info }}
</div>
<VueLoadingBar
v-if="progress.progress !== -1"
:value="progress.progress"
/>
</div>
</template>
</div>
</VueLoadingIndicator>
</div>
</transition>
</template>
<script>
import { DisableScroll } from '@vue/ui'
import Progress from '../mixins/Progress'
export default {
mixins: [
DisableScroll,
Progress
],
methods: {
close () {
this.progress = null
}
}
}
</script>
<style lang="stylus" scoped>
@import "~@/style/imports"
.loading-screen
position absolute
.content
display grid
grid-template-columns 1fr
grid-gap $padding-item
text-align center
.error
color $vue-ui-color-danger
v-box()
box-center()
> .vue-ui-icon
margin-bottom $padding-item
>>> svg
fill @color
.actions
margin-top $padding-item
.secondary-info
position absolute
bottom 42px
left 0
right 0
v-box()
box-center()
.info
color $color-text-light
.vue-ui-loading-bar
width 50vw
max-width 400px
margin-top 24px
&:not(.loading)
.vue-ui-loading-indicator
>>> .animation
display none
&.loading
.content
margin-top $padding-item
</style>