Created
March 29, 2019 15:55
-
-
Save yuizho/68c7366309ab258ee231694105bbc96d to your computer and use it in GitHub Desktop.
JS Bin [vue js training template] // source https://jsbin.com/rageyap
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 name="description" content="[vue js training template]"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.v-enter-active, .v-leave-active { | |
transition: opacity 1s; | |
} | |
.v-enter, .v-leave-to { | |
opacity: 0; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="app"> | |
<p v-if="show">{{message}}</p> | |
<input v-model="message"> | |
<ol> | |
<li v-for="item in list">{{item}}</li> | |
</ol> | |
<button v-on:click="handleClick">Click</button> | |
<br> | |
<br> | |
<button v-on:click="show=!show">切り替え</button> | |
<transition> | |
<p v-if="show">{{message}}</p> | |
</transition> | |
</div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script> | |
<script id="jsbin-javascript"> | |
var app = new Vue({ | |
el: '#app', | |
data: { | |
message: '初期メッセージ', | |
list: ['りんご', 'ばなな', 'いちご'], | |
handleClick: function(event) { | |
alert(event.target) | |
}, | |
show: true | |
} | |
}) | |
</script> | |
<script id="jsbin-source-css" type="text/css">.v-enter-active, .v-leave-active { | |
transition: opacity 1s; | |
} | |
.v-enter, .v-leave-to { | |
opacity: 0; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var app = new Vue({ | |
el: '#app', | |
data: { | |
message: '初期メッセージ', | |
list: ['りんご', 'ばなな', 'いちご'], | |
handleClick: function(event) { | |
alert(event.target) | |
}, | |
show: true | |
} | |
}) | |
</script></body> | |
</html> |
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
.v-enter-active, .v-leave-active { | |
transition: opacity 1s; | |
} | |
.v-enter, .v-leave-to { | |
opacity: 0; | |
} |
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
var app = new Vue({ | |
el: '#app', | |
data: { | |
message: '初期メッセージ', | |
list: ['りんご', 'ばなな', 'いちご'], | |
handleClick: function(event) { | |
alert(event.target) | |
}, | |
show: true | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment