Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!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
You can’t perform that action at this time.