Toast function not showing

Viewed 24
 submit() {
                if(this.submitvalidtion()) {
                    
                    this.loading = true;
                    axios.post('/api/vaccine/create_baby_info', this.form).then(res => res.data).then(res => {
                        //console.log(JSON.stringify(res));
                        this.$bvToast.toast(res.data.message,{ variant:'success', noCloseButton: true,solid:true})
                       
                     
                        
                        this.loading = false;
    
                    })
                    .catch((error) => {
                       let error_msg = error.res.data.message;
                       this.$bvToast.toast(error_msg,{ variant:'danger', noCloseButton: true, solid:true})
                       this.loading = false;
                    });
                }
            },

Hi i am new to vue js, and can someone help me with this. After i clicked the submit button , the 'toast' function not showing up

1 Answers

Call function inside methods in this way:

submit: function () {
    // condition code add here
}

For calling submit function call in this way

vm.submit()
Related