-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Input models not binding to form (#28)
* slip delete modal * fixed delete route * fixed upload inputs * fixed upload inputs
- Loading branch information
Showing
9 changed files
with
572 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script setup> | ||
import { router } from '@inertiajs/vue3' | ||
import WarningButton from '@/Components/Reusable/WarningButton.vue' | ||
import PrimaryButton from '@/Components/Reusable/PrimaryButton.vue' | ||
const props = defineProps({ | ||
slip: Object, | ||
}) | ||
const emit = defineEmits(['close']) | ||
const deleteSlip = () => { | ||
router.delete(`/slips/${props.slip.token}`, { | ||
onFinish: () => closeModal(), | ||
}) | ||
} | ||
const closeModal = () => { | ||
// form.reset() | ||
emit('close') | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="backdrop-blur-sm w-full h-full absolute top-0 left-0"> | ||
<div class="flex flex-col absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 bg-[rgba(0,0,0,0.8)] rounded-2xl w-3/4"> | ||
<div class="m-2"> | ||
<p class="text-gray-200">Are you sure?</p> | ||
<p class="text-gray-200">{{ slip.title }} will be <span class="text-red-600">permanently deleted</span>.</p> | ||
<div class="flex text-gray-200 mt-6 justify-around"> | ||
<div class="w-1/4"> | ||
<WarningButton @click="deleteSlip">Delete</WarningButton> | ||
</div> | ||
<div class="w-1/4"> | ||
<PrimaryButton @click="closeModal">Cancel</PrimaryButton> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
<script setup> | ||
const props = defineProps({ | ||
modelValue: String, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<select class="w-full bg-brand-secondary-700 focus:ring-0 focus:border-brand-primary-500"> | ||
<select | ||
class="w-full bg-brand-secondary-700 focus:ring-0 focus:border-brand-primary-500" | ||
:value="modelValue" | ||
@change="$emit('update:modelValue', $event.target.value)" | ||
> | ||
<slot /> | ||
</select> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
<script setup> | ||
const props = defineProps({ | ||
modelValue: String, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<input class="w-full bg-brand-secondary-700 border border-black focus:border-brand-primary-500 focus:ring-0" type="text" /> | ||
<input | ||
class="w-full bg-brand-secondary-700 border border-black focus:border-brand-primary-500 focus:ring-0" type="text" | ||
:value="modelValue" | ||
@input="$emit('update:modelValue', $event.target.value)" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
<script setup> | ||
const props = defineProps({ | ||
modelValue: String, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<textarea class="w-full bg-brand-secondary-700 border-black focus:ring-0 focus:border-brand-primary-500" /> | ||
<textarea | ||
class="w-full bg-brand-secondary-700 border-black focus:ring-0 focus:border-brand-primary-500" | ||
:value="modelValue" | ||
@input="$emit('update:modelValue', $event.target.value)" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters