primevue-mirror/doc/dynamicdialog/CloseDialogDoc.vue

42 lines
940 B
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>The <i>close</i> function of the <i>dialogRef</i> is used to hide a Dialog. The <i>dialogRef</i> is injected to the component that is loaded by the dialog.</p>
</DocSectionText>
2023-03-13 13:31:27 +00:00
<DocSectionCode :code="code" importCode hideCodeSandbox hideStackBlitz />
2023-02-28 08:29:30 +00:00
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `export default {
2023-02-28 08:29:30 +00:00
inject: ['dialogRef'],
methods:{
closeDialog() {
this.dialogRef.close();
}
}
}`,
options: `
export default {
inject: ['dialogRef'],
methods:{
closeDialog() {
this.dialogRef.close();
}
}
}`,
composition: `
import { inject } from "vue";
const dialogRef = inject('dialogRef');
const closeDialog = () => {
dialogRef.value.close();
}`
}
};
}
};
</script>