delucaspinto

[VUE - LARAVEL] TWO INPUTS VALIDATION

Jul 24th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.js'></script>
  2. <script>
  3. var app = new Vue({
  4.   el: '#app',
  5.   data: {
  6.     atual_senha: null,
  7.     nova_senha: null,
  8.     repetir_nova_senha: null,
  9.     isShow: null,
  10.   },
  11.   methods: {
  12.     isEqual: function(nova_senha, repetir_nova_senha){
  13.       if(nova_senha || repetir_nova_senha){
  14.         if (repetir_nova_senha.length > 0) {
  15.           if (repetir_nova_senha == nova_senha) {
  16.             app.isShow = true;
  17.             return "";
  18.           } else {
  19.             app.isShow = false;
  20.             return "Nova Senha não combina com a Repetida";
  21.           }
  22.         } else {app.isShow = false;}
  23.       }
  24.     }
  25.   }
  26. });
  27.  
  28. </script>
Advertisement
Add Comment
Please, Sign In to add comment