forked from qier222/YesPlayMusic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathToast.vue
51 lines (46 loc) · 1.01 KB
/
Toast.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
<template>
<transition name="fade">
<div v-show="toast.show" class="toast">{{ toast.text }}</div>
</transition>
</template>
<script>
import { mapState } from 'vuex';
export default {
name: 'Toast',
computed: {
...mapState(['toast']),
},
};
</script>
<style lang="scss" scoped>
.toast {
position: fixed;
bottom: 64px;
left: 50%;
transform: translate(-50%, -50%);
font-size: 14px;
color: var(--color-text);
background: rgba(255, 255, 255, 0.88);
box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.08);
border: 1px solid rgba(0, 0, 0, 0.06);
backdrop-filter: blur(12px);
border-radius: 8px;
box-sizing: border-box;
padding: 6px 12px;
z-index: 1010;
}
[data-theme='dark'] {
.toast {
background: rgba(46, 46, 46, 0.68);
backdrop-filter: blur(16px) contrast(120%);
border: 1px solid rgba(255, 255, 255, 0.08);
}
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
</style>