Repository navigation
Expand file tree
/
Copy pathindex.vue
More file actions
executable file
·135 lines (129 loc) · 2.96 KB
/
Copy pathindex.vue
File metadata and controls
executable file
·135 lines (129 loc) · 2.96 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<template>
<transition name="fade" v-if="styleLoadingIsOpen">
<view
class="mask"
v-show="isActive"
:class="{ 'full-screen': isFullScreen }"
:style="{ backgroundColor }"
>
<view
class="spinner"
:style="{ transform: `translate(-50%, -${translateY}%)` }"
>
<slot>
<loop v-if="styleLoadingType === 'loop'" :color="themeColor.color" :size="size" />
<shrinkRect v-if="styleLoadingType === 'shrinkRect'" :color="themeColor.color" :size="size" />
<bounce v-if="styleLoadingType === 'bounce'" :color="themeColor.color" :size="size" />
<doubleBounce v-if="styleLoadingType === 'doubleBounce'" :color="themeColor.color" :size="size" />
<doubleCube v-if="styleLoadingType === 'doubleCube'" :color="themeColor.color" :size="size" />
<doubleDot v-if="styleLoadingType === 'doubleDot'" :color="themeColor.color" :size="size" />
<rotatePlane v-if="styleLoadingType === 'rotatePlane'" :color="themeColor.color" :size="size" />
<scaleOut v-if="styleLoadingType === 'scaleOut'" :color="themeColor.color" :size="size" />
</slot>
<view v-if="text.length" :style="{ color: textColor }">
{{ text }}
</view>
</view>
</view>
</transition>
</template>
<script>
// ==========在这里选一个您要的其他去掉也行==========
import loop from './loaders/loop.vue';
import bounce from './loaders/bounce.vue';
import doubleBounce from './loaders/double-bounce.vue';
import doubleCube from './loaders/double-cube.vue';
import doubleDot from './loaders/double-dot.vue';
import rotatePlane from './loaders/rotate-plane.vue';
import scaleOut from './loaders/scale-out.vue';
import shrinkRect from './loaders/shrink-rect.vue';
// ==========在这里选一个您要的其他去掉也行==========
export default {
name: 'rfLoading',
components: {
loop,
bounce,
doubleBounce,
doubleCube,
doubleDot,
rotatePlane,
scaleOut,
shrinkRect
},
props: {
active: Boolean,
translateY: {
type: Number,
default: 150
},
text: {
type: String,
default: ''
},
color: {
type: String,
default: '#333'
},
textColor: {
type: String,
default: '#333'
},
isFullScreen: {
type: Boolean,
default: false
},
backgroundColor: {
type: String,
default: 'rgba(255, 255, 255, .9)'
},
size: {
type: Number,
default: 40
}
},
data() {
return {
isActive: this.active || false,
styleLoadingIsOpen: this.$mSettingConfig.styleLoadingIsOpen,
styleLoadingType: this.$mSettingConfig.styleLoadingType
};
},
watch: {
active(value) {
this.isActive = value;
}
}
};
</script>
<style scoped>
.mask {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 3000;
transition: opacity 0.3s linear;
}
.full-screen {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.spinner {
position: absolute;
top: 50%;
left: 50%;
text-align: center;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s;
}
.fade-enter,
.fade-leave-to {
opacity: 0;
}
</style>