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,
serverError: panel.serverError,
}"
@apply="onApply"
@submit="onApply"
:no-footer="!panel.hasApplyButton"
>
<slot name="tab-top" />

View file

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

View file

@ -34,6 +34,8 @@
export default {
name: 'AbstractForm',
inheritAttrs: false,
props: {
id: { type: String, default: 'ynh-form' },
submitText: { type: String, default: null },
@ -60,8 +62,7 @@ export default {
v.$touch()
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('apply')
this.$emit('submit')
},
},
}