In this point you might ask "What about the v-if
directive we mentioned earlier?". So, at this point we will build the previous example again, only this time we'll use v-if
!
<html> <head> <title>Hello Vue</title> </head> <body> <div id="app"> <h1 v-if="!message">You must send a message for help!</h1> <textarea v-model="message"></textarea> <button v-show="message"> Send word to allies for help! </button> <pre> {{$data | json}} </pre> </div> </body> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js"></script> <script> new Vue({ el: '#app', data: { message: 'Our king is dead! Send help!' } }) </script> </html>
As shown, the...