title: VueJS: Is there an easy way to validate email and password on client side based on the server side's validator?
body: <p>I'm new to VueJS. I'm creating signup and login page and users are supposed to send the email and password to the back-end (I'm using Django) to check if the data is valid. I'd like to show error messages on form if one of them are not valid.  </p>
  
  <p>I saw some documentation about validation and seems like I have to write a bunch of validation code. Now I'm wondering if there's an easy way to do it.
  I'd like to validate them based on the server side's validators.</p>
  
  <p><code>Login.vue</code></p>
  
  <pre><code>export default {
  data() {
      return {
          form: {
              email: '',
              password: '',
          }
      }
  },
  methods: {
      onSubmit(event) {
          event.preventDefault()
  
          // validate the inputs here and shows error messages if they are not valid
  
          const path = `http://127.0.0.1:8000/users/login/`
          axios.post(path, this.form).then((resp) =&gt; {
              location.href = '/'
          })
          .catch((err) =&gt; {
              console.log(err)
          })
      }
  }
  </code></pre>
  
  <p>}
  </p>
  
  <p>Can anyone give me tips?</p>