简体   繁体   English

如何在按钮单击时关闭 Vuesax 弹出屏幕?

[英]How to close Vuesax PopUp screen on button click?

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.我在 VueSax PopUp 屏幕中创建了一个表单,并且在单击按钮时提交了表单,但是一旦提交了 from,PopUp 就不会关闭。 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'
            });
        });

    },

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.在 API 部分的 vuesax 文档中,我可以看到“active.sync”道具通过更改此道具的值来确定弹出窗口是否处于活动状态(可见),您可以关闭弹出窗口。 Vuesax Documentation Vuesax 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM