title: How can I allow only numbers and letters on Vue Js?
body: <p>I want on the field <code>name</code> allow only numbers and letters and on the field <code>number</code> only allow numbers.</p>
  
  <p>How I should do it, where can I see a doc where explain it, like my question?</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>const app = new Vue({
    el: '#app',
    data: {
      name: null,
      number: null
    },
    methods: {
      checkForm: function (e) {
        if (this.name) {
        return true;
        }
        if (!this.name) {
          console.log("Required");
        }
        if (this.number) {
        return true;
        }
        if (!this.number) {
          console.log("Required");
        }
        e.preventDefault();
      }
    }
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"&gt;&lt;/script&gt;
  &lt;form id="app" @submit="checkForm" method="post" novalidate="true"&gt;
    &lt;p&gt;
      &lt;label for="name"&gt;Name&lt;/label&gt;
      &lt;input id="name" v-model="name" type="text" name="name"&gt;
      &lt;input id="number" v-model="number" type="text" name="number"&gt;
    &lt;/p&gt;
      &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks!</p>