我正在使用nuxt.js,并且有一个按钮来提交一种方法的表单。在提交表单之前,我需要将一些数据存储在存储中,但是它会跳过我的提交并提交表单。
在这种情况下我应该使用什么?
提交消息,并在设置消息后提交表单。我需要提取,Ascync还是Promise?
表格
<form ref="sfForm" action="http://blahblah/thank-you" method="post" @submit.prevent="sfFormSubmit('contactUs')">
方法
methods: {
sfFormSubmit(type){
this.$store.commit('messages/setFormMessage', type);
this.$refs.sfForm.submit();
}
}