How to close Vuesax PopUp screen on button click?

Viewed 1025

I have created a form inside the VueSax PopUp screen and the form is being submitted on button click, but the PopUp is not getting closed once the from is submitted. Please help with code.

Once the submit button is clicked it hits the bellow method.

  createRecord() {

        this.$vs.loading();


          jwt.createLeads(this.newRecord).then((response) => {

            this.$vs.loading.close();

            this.$store.dispatch("userManagement/upsertToState", { type: "Leads", data: response.data.leads });

            this.newRecord.leadtype = this.newRecord.first_name = this.newRecord.last_name = this.newRecord.email_id = this.newRecord.phone_number = this.newRecord.location = this.newRecord.postcode = this.newRecord.lead_address = this.newRecord.gender = this.newRecord.lead_source = this.newRecord.required_sub = this.newRecord.teach_mode = this.newRecord.location_pref = this.newRecord.lead_frequency = this.newRecord.session_duration = this.newRecord.pref_days = this.newRecord.pref_time_slot = this.newRecord.tutor_pref = this.newRecord.lead_owner = this.newRecord.notes = ''

           alert("Lead Creation Success");
           location.reload();
        }).catch((error) => {
            console.log(error)

            this.$vs.loading.close();


            this.$vs.notify({
                title: 'Error',
                text: 'There was an error creating the Lead',
                iconPack: 'feather',
                icon: 'icon-alert-circle',
                color: 'danger'
            });
        });

    },
1 Answers

In vuesax documentation at the API section I can see that "active.sync" prop determines if the popup is active (visible) by changing the value of this prop you can close the popup. Vuesax Documentation

Related