mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Updated DynamicDialog documentation
This commit is contained in:
parent
03732ab3f8
commit
dbac600078
11 changed files with 160 additions and 195 deletions
|
@ -1,8 +1,8 @@
|
|||
<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>
|
||||
<p>The <i>close</i> function is available through a <i>dialogRef</i> that is injected to the component loaded by the dialog.</p>
|
||||
</DocSectionText>
|
||||
<DocSectionCode :code="code" importCode hideCodeSandbox hideStackBlitz />
|
||||
<DocSectionCode :code="code" importCode hideToggleCode hideCodeSandbox hideStackBlitz />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -11,33 +11,14 @@ export default {
|
|||
return {
|
||||
code: {
|
||||
basic: `
|
||||
export default {
|
||||
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();
|
||||
}`
|
||||
}
|
||||
`
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue