You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had also this and a similar issue yesterday and i've dug a bit deeper and found multiple reason for this issue:
The documentation is missing the emits object at the code example
That one was a easy to find, it's just simply missing in the documentation and needs to be added.
Vue event listeners are passed as props with an on Prefix but emit it on the child component side
I've looked deeper into the code and noticed that the emits are directly bound via v-bind and this applies the emits only if they have the on prefix. Otherwise everything else is just passed as a props directly to the child event and thus not properly bubbling up the event. Also you have to remove the on inside the child component otherwise it will not work.
Also since this was suboptimal in my opinion i've decided to make a pull request (#5679) which makes DynamicDialog a lot more flexible and also adjusted how emits are added to the child component 😉
Describe the bug
There is Events section in docs for the DynamicDialog.
We have example with providing two emit events
const emit = defineEmits(['onCancel', 'onSave'])
But it doesn't work. Right now works only one emit - onClose.
May be we have mistake in the documentation and there is a right way to write own emts.
Reproducer
https://stackblitz.com/edit/mkfekr?file=src%2FApp.vue
PrimeVue version
3.52.0
Vue version
3.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
I expect ability to write own emit as I see in documentation.
The text was updated successfully, but these errors were encountered: