Guest User

Untitled

a guest
Mar 16th, 2017
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <script>
  2. import validator from "../vendors/bootstrapvalidator/dist/js/bootstrapValidator.min.js"
  3. export default {
  4. name: "login",
  5. data() {
  6. return {
  7. abc: "asd"
  8. }
  9. },
  10. mounted: function() {
  11. var x = this;
  12. $(document).ready(function() {
  13. //=================Preloader===========//
  14. $(window).on('load', function() {
  15. $('.preloader img').fadeOut();
  16. $('.preloader').fadeOut();
  17. });
  18. //=================end of Preloader===========//
  19. $('input').iCheck({
  20. checkboxClass: 'icheckbox_square-blue',
  21. radioClass: 'iradio_minimal-blue',
  22. increaseArea: '20%' // optional
  23. });
  24. $("#authentication").bootstrapValidator({
  25. fields: {
  26. username: {
  27. validators: {
  28. notEmpty: {
  29. message: 'The email address is required'
  30. },
  31. regexp: {
  32. regexp: /^\S+@\S{1,}\.\S{1,}$/,
  33. message: 'Please enter valid email format'
  34. }
  35. }
  36. },
  37. password: {
  38. validators: {
  39. notEmpty: {
  40. message: 'Password is required'
  41. }
  42.  
  43. }
  44. }
  45.  
  46. }
  47. }).on('success.form.bv', e => { //if form validates successfully
  48. // e.preventDefault(); // prevents default action
  49. // this.showErrorMessage(true); < -- -- -- --this is where i get the error by calling a method defined in component
  50. alert(x.abc);
  51. });
  52.  
  53. });
  54. },
  55. destroyed: function() {
  56.  
  57. }
  58. }
  59. </script>
Add Comment
Please, Sign In to add comment