fix: ConfigPanels event bubbling

This commit is contained in:
axolotle 2024-03-18 18:24:00 +01:00
parent 6be1609f10
commit 9ec1fbd714
4 changed files with 5 additions and 9 deletions

View file

@ -6,7 +6,7 @@
validation, validation,
serverError: panel.serverError, serverError: panel.serverError,
}" }"
@apply="onApply" @submit="onApply"
:no-footer="!panel.hasApplyButton" :no-footer="!panel.hasApplyButton"
> >
<slot name="tab-top" /> <slot name="tab-top" />

View file

@ -5,7 +5,6 @@
v-if="routes_.length > 1" v-if="routes_.length > 1"
v-bind="{ panels, forms, v: v$, ...$attrs }" v-bind="{ panels, forms, v: v$, ...$attrs }"
:routes="routes_" :routes="routes_"
@apply="$emit('apply', $event)"
> >
<template #tab-top> <template #tab-top>
<slot name="tab-top" /> <slot name="tab-top" />

View file

@ -16,11 +16,7 @@
<!-- Bind extra props to the child view and forward child events to parent --> <!-- Bind extra props to the child view and forward child events to parent -->
<RouterView v-slot="{ Component }"> <RouterView v-slot="{ Component }">
<Component <Component v-bind="$attrs" :is="Component">
v-bind="$attrs"
:is="Component"
@apply="$emit('apply', $event)"
>
<template #tab-top> <template #tab-top>
<slot name="tab-top" /> <slot name="tab-top" />
</template> </template>

View file

@ -34,6 +34,8 @@
export default { export default {
name: 'AbstractForm', name: 'AbstractForm',
inheritAttrs: false,
props: { props: {
id: { type: String, default: 'ynh-form' }, id: { type: String, default: 'ynh-form' },
submitText: { type: String, default: null }, submitText: { type: String, default: null },
@ -60,8 +62,7 @@ export default {
v.$touch() v.$touch()
if (v.$pending || v.$errors.length) return if (v.$pending || v.$errors.length) return
} }
// Weird bug with `INSTANCE_LISTENERS: true` with 'submit' event (double exec before of conflict with native submit event?) this.$emit('submit')
this.$emit('apply')
}, },
}, },
} }