diff --git a/components/CookbookForm.js b/components/CookbookForm.js
index bffda3a..6ed804a 100644
--- a/components/CookbookForm.js
+++ b/components/CookbookForm.js
@@ -1,7 +1,7 @@
export default {
name: "CookbookForm",
setup() {
- const { ref } = Vue;
+ const { ref, computed } = Vue;
const title = ref("");
const description = ref("");
@@ -9,6 +9,10 @@ export default {
const logs = ref([""]);
const who = ref("");
+ const disabled = computed(() => {
+ return [title, description, nature, logs, who].some((input) => input.value == "");
+ });
+
const submit = function () {
fetch("https://hub.xpub.nl/soupboat/cookbook/", {
method: "POST",
@@ -23,7 +27,7 @@ export default {
});
};
- return { title, description, nature, logs, who, submit };
+ return { title, description, nature, logs, who, disabled, submit };
},
template: `
{{recipe.description}}
+{{recipe.who}}
+