Created
February 27, 2019 10:04
-
-
Save niconico25/7bb0fb2ed1d46cb26f1de2965b4b992e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<div id="app"> | |
<header> | |
<button v-on:click="show=!show">切り替え</button> | |
</header> | |
<div> | |
<!-- | |
jpg ファイルは適宜ご用意ください。 | |
--> | |
<transition appear> | |
<img v-if="show" src="./fig.jpg" v-cloak> | |
</transition> | |
<transition appear> | |
<img v-if="show" src="./fig.jpg"> | |
</transition> | |
<transition> | |
<img v-if="show" src="./fig.jpg"> | |
</transition> | |
</div> | |
</div> | |
<style type="text/css"> | |
[v-cloak] { | |
display: none; | |
} | |
.v-enter-active, .v-leave-active { | |
transition: opacity 1s, transform 1s; | |
} | |
.v-enter, .v-leave-to { | |
opacity: 0; | |
transform: translateY(40px); | |
} | |
header { | |
text-align: right; | |
} | |
p { | |
font-size: 50px; | |
text-align: center; | |
} | |
img { | |
width: 200px; | |
} | |
</style> | |
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.7/dist/vue.js"></script> | |
<script> | |
app = new Vue({ | |
el: '#app', | |
data: { | |
show: true, | |
}, | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment