title: How to check input box is empty by v-model in Vue JS?
body: <p>In my learning app about Vue, I bind <code>message</code> with the input box using <code>v-model</code> of vue. In that, I set another method to check if the input box is empty then I set default <code>message</code> value to something else by default.</p>
  
  <p>This below is my snippet:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var app = new Vue({
    el: '#app',
    data: {
      message: 'Hello Vue!'
    },
    methods:{
     check:function(){
      if (this.message==''){
       this.message='Please enter text in text box below';
      }
     }
    }
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="index.css"&gt;
          &lt;script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;!--
          v-model:
          Used with form input for user synchronize data between front-end and back-end
          as seen here message is bind with form input, so whenver we update the form, the var message
          will be updated as well
       --&gt;
          &lt;div id="app"&gt;
              &lt;p&gt;{{ message }}&lt;/p&gt;
              &lt;input v-model="message" v-on="check"&gt;
          &lt;/div&gt;
          
          &lt;script src="index.js"&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>However, it seemed like <code>v-on="check"</code> does not work as well as the input box is empty the <code>message</code> does not change. Is there anything I was missing? </p>
  
  <p>PS: I am new to VueJS :) </p>