I'm facing problems with the component DynamicDialog in Vue Composition API. The custom event not firing.
Code: Select all
// Parent component
<script setup>
import {useDialog} from "primevue/usedialog";
const dialog = useDialog();
function userDialog()
{
dialog.open(UserDetail, {
props: {
style: {
width: '50vw',
},
breakpoints:{
'960px': '75vw',
'640px': '90vw'
},
modal: true
},
emits: {
onDeactivate: (info) => {
console.log(info);
}
}
});
}
</script>
<template>
<button @click="userDialog">Open dialog</button>
</template>
Code: Select all
<script setup>
const emit = defineEmits(['deactivate']);
function deactivate(){
emit('deactivate', {info: 'my info'});
}
</script>
<template>
<button @click="deactivate">Deactivate</button>
</template>
Anyone has a idea what I'm doing wrong?
PS: I'm using PrimeVue 3.23.0.