-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
45 lines (44 loc) · 1.09 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CSS Transitions</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/0.5.0/modern-normalize.min.css">
</head>
<body>
<style>
.fade-enter-active {
transition: all 0.5s 1s ease;
}
.fade-leave-active {
transition: all 1s 1s ease;
}
.fade-enter, .fade-leave-to {
transform: translateY(20px);
opacity: 0;
}
#root > div {
background: bisque;
padding: 10px;
width: 300px;
}
</style>
<div id="root">
<button @click="divVisible = !divVisible">Toggle visibility</button>
<transition name="fade">
<div v-if="divVisible">CLick the button to toggle my visibility</div>
</transition>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
<script>
new Vue({
el: '#root',
data: {
divVisible: true
}
})
</script>
</body>
</html>