return { ...props, setConfirmationDialog, setMessage, setError }
},
methods: {
/**
* Navigates to the show page of the given resource.
*
* @param {Object} resource - The resource to navigate to
* @return {void}
*/
goToResourceShow: function (resource, dt, event) {
event?.preventDefault()
this.$router.push({
name: this.show_component,
params: { [this.id_attr]: resource[this.id_attr] },
})
* Navigates to the edit page of the given resource.
props: {
resource_name: String,
id_attr: String,
show_component: String,
add_component: String,
edit_component: String,
...BaseResource.setup({
resource_name: "agreement",
id_attr: "agreement_id",
show_component: "AgreementsShow",
add_component: "AgreementsFormAdd",
edit_component: "AgreementsFormAddEdit",
}),
<KohaTable
ref="table"
v-bind="tableOptions"
@show="doShow"
@show="goToResourceShow"
@edit="goToResourceEdit"
@delete="doDelete"
@select="doSelect"
error => {}
)
doShow: function ({ agreement_id }, dt, event) {
event.preventDefault()
name: "AgreementsShow",
params: { agreement_id },
doDelete: function (agreement, dt, event) {
this.setConfirmationDialog(
{
-