Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- import validator from "../vendors/bootstrapvalidator/dist/js/bootstrapValidator.min.js"
- export default {
- name: "login",
- data() {
- return {
- abc: "asd"
- }
- },
- mounted: function() {
- var x = this;
- $(document).ready(function() {
- //=================Preloader===========//
- $(window).on('load', function() {
- $('.preloader img').fadeOut();
- $('.preloader').fadeOut();
- });
- //=================end of Preloader===========//
- $('input').iCheck({
- checkboxClass: 'icheckbox_square-blue',
- radioClass: 'iradio_minimal-blue',
- increaseArea: '20%' // optional
- });
- $("#authentication").bootstrapValidator({
- fields: {
- username: {
- validators: {
- notEmpty: {
- message: 'The email address is required'
- },
- regexp: {
- regexp: /^\S+@\S{1,}\.\S{1,}$/,
- message: 'Please enter valid email format'
- }
- }
- },
- password: {
- validators: {
- notEmpty: {
- message: 'Password is required'
- }
- }
- }
- }
- }).on('success.form.bv', e => { //if form validates successfully
- // e.preventDefault(); // prevents default action
- // this.showErrorMessage(true); < -- -- -- --this is where i get the error by calling a method defined in component
- alert(x.abc);
- });
- });
- },
- destroyed: function() {
- }
- }
- </script>
Add Comment
Please, Sign In to add comment