s3e37 v-show

This commit is contained in:
Tyrel Souza 2018-04-13 22:54:45 -04:00
parent b7bc1d8829
commit 25a3f1612a
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0

View File

@ -7,7 +7,9 @@
</head> </head>
<body> <body>
<div id='app'> <div id='app'>
<button type="button" name="button" @click="show = !show">Switch</button> <button type="button" name="button" @click="show = !show">
Switch
</button>
<p v-if="show">You can see me</p> <p v-if="show">You can see me</p>
<p v-else>Now you see me</p> <p v-else>Now you see me</p>
@ -15,7 +17,7 @@
<h1>Heading</h1> <h1>Heading</h1>
<p>Inside a template</p> <p>Inside a template</p>
</template> </template>
<p>Do you also see me?</p> <p v-show="show">Do you also see me?</p>
</div> </div>
<script src="app.js" charset="utf-8"></script> <script src="app.js" charset="utf-8"></script>
</body> </body>