Koha/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Agreements.vue
Jonathan Druart 5537c81311
Bug 32030: Store current_view and messages
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-08 09:43:47 -03:00

47 lines
1.2 KiB
Vue

<template>
<Toolbar v-if="current_view == 'list'" />
<Dialog />
<List
v-if="current_view == 'list'"
/>
<Show
v-if="current_view == 'show'"
:agreement_id="current_object_id"
/>
<AddForm
v-if="current_view == 'add-form'"
:agreement_id="current_object_id"
/>
<ConfirmDeleteForm
v-if="current_view == 'confirm-delete-form'"
:agreement_id="current_object_id"
/>
</template>
<script>
import Dialog from "./Dialog.vue"
import Toolbar from "./AgreementsToolbar.vue"
import List from "./AgreementsList.vue"
import Show from "./AgreementsShow.vue"
import AddForm from "./AgreementsFormAdd.vue"
import ConfirmDeleteForm from "./AgreementsFormConfirmDelete.vue"
import { useMainStore } from "../../stores/main"
import { storeToRefs } from "pinia"
export default {
setup() {
const mainStore = useMainStore()
const { current_object_id, current_view } = storeToRefs(mainStore)
return { current_object_id, current_view };
},
components: {
Dialog,
Toolbar,
List,
Show,
AddForm,
ConfirmDeleteForm,
},
};
</script>