我在 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/