WL-11 - Handle close feedback message + Reset form after submission + Honeypot value set to empty string

This commit is contained in:
2020-10-28 14:31:40 +01:00
parent 4f011c17e0
commit 2360971b20

View File

@@ -17,7 +17,10 @@
feedback.hasError ? "Error !" : "Thanks !" feedback.hasError ? "Error !" : "Thanks !"
}}</strong> }}</strong>
<span class="block sm:inline">{{ feedback.message }}</span> <span class="block sm:inline">{{ feedback.message }}</span>
<span class="absolute top-0 bottom-0 right-0 px-4 py-3"> <span
class="absolute top-0 bottom-0 right-0 px-4 py-3"
@click="closeFeedback"
>
<svg <svg
:class=" :class="
(feedback.hasError ? 'text-red-500' : 'text-green-500') + (feedback.hasError ? 'text-red-500' : 'text-green-500') +
@@ -114,7 +117,7 @@ export default {
fullname: "", fullname: "",
email: "", email: "",
message: "", message: "",
honeypot: null honeypot: ""
}, },
showFeedback: false, showFeedback: false,
feedback: { feedback: {
@@ -153,7 +156,20 @@ export default {
}) })
.finally(() => { .finally(() => {
this.showFeedback = true; this.showFeedback = true;
this.form = {
fullname: "",
email: "",
message: "",
honeypot: ""
};
}); });
},
closeFeedback() {
this.showFeedback = false;
this.feedback = {
hasError: false,
message: ""
};
} }
} }
}; };