52 lines
1.2 KiB
Vue
52 lines
1.2 KiB
Vue
<script setup>
|
|
import { onMounted, ref } from 'vue';
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
import { api, useForm } from '@Services/Api';
|
|
import { apiTo, transl, viewTo } from './Module';
|
|
|
|
import IconButton from '@Holos/Button/Icon.vue'
|
|
import Input from '@Holos/Form/Input.vue';
|
|
import Selectable from '@Holos/Form/Selectable.vue';
|
|
import PageHeader from '@Holos/PageHeader.vue';
|
|
import Form from './Form.vue'
|
|
|
|
/** Definidores */
|
|
const router = useRouter();
|
|
|
|
/** Propiedades */
|
|
const form = useForm({
|
|
name: '',
|
|
description: '',
|
|
});
|
|
|
|
/** Métodos */
|
|
function submit() {
|
|
form.post(apiTo('store'), {
|
|
onSuccess: () => {
|
|
Notify.success(Lang('register.create.onSuccess'))
|
|
router.push(viewTo({ name: 'index' }));
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<PageHeader
|
|
:title="transl('create.title')"
|
|
>
|
|
<RouterLink :to="viewTo({ name: 'index' })">
|
|
<IconButton
|
|
class="text-white"
|
|
icon="arrow_back"
|
|
:title="$t('return')"
|
|
filled
|
|
/>
|
|
</RouterLink>
|
|
</PageHeader>
|
|
<Form
|
|
action="create"
|
|
:form="form"
|
|
@submit="submit"
|
|
/>
|
|
</template>
|