vue.js - 如何在单击按钮时关闭 Vuesax PopUp 屏幕?

标签 vue.js popup vue-component

我在 VueSax PopUp 屏幕中创建了一个表单,并且在单击按钮时提交了该表单,但是一旦提交 from,PopUp 就不会关闭。请帮助编写代码。

单击提交按钮后,它会触发下面的方法。

  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'
            });
        });

    },

最佳答案

在 API 部分的 vuesax 文档中,我可以看到“active.sync”属性通过更改此属性的值来确定弹出窗口是否处于事件状态(可见),您可以关闭弹出窗口。 Vuesax Documentation

关于vue.js - 如何在单击按钮时关闭 Vuesax PopUp 屏幕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61636121/

相关文章:

javascript - 如何正确模拟 DOM,以便我可以使用 Jest 测试使用 Xterm.js 的 Vue 应用程序?

vue.js - 在Vue js中使用v-show属性显示/隐藏元素

c# - 以编程方式将项目添加到弹出窗口

javascript - axios get 函数在 get 方法中参数为 null 或为空时会导致 404 错误

javascript - 在Vue中使用Axios Api发布数据

javascript - 在javascript弹出窗口中显示php页面

javascript - 单击“喜欢”按钮后,我的应用程序如何请求 FB 权限?

javascript - vue 中对象属性变为空白

vue.js - 如何在组件之间传递状态?