- vue composition api (#91)

* wip

* fix

Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
This commit is contained in:
Adrian Hopek
2022-03-22 15:03:42 +01:00
committed by GitHub
parent 95f5ed44d6
commit dcda8c6255
33 changed files with 938 additions and 1466 deletions

View File

@@ -81,34 +81,19 @@
</div>
</template>
<script>
import {useForm} from '@inertiajs/inertia-vue3'
<script setup>
import { useForm } from '@inertiajs/inertia-vue3'
import FlatPickr from 'vue-flatpickr-component'
import useCurrentYearPeriodInfo from '@/Composables/yearPeriodInfo'
export default {
name: 'HolidayCreate',
components: {
FlatPickr,
},
setup() {
const form = useForm({
name: null,
date: null,
})
const form = useForm({
name: null,
date: null,
})
const {minDate, maxDate} = useCurrentYearPeriodInfo()
const { minDate, maxDate } = useCurrentYearPeriodInfo()
return {
form,
minDate,
maxDate,
}
},
methods: {
createHoliday() {
this.form.post('/holidays')
},
},
function createHoliday() {
form.post('/holidays')
}
</script>