primevue-mirror/doc/dynamicdialog/CustomizationDoc.vue

50 lines
1.4 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>DynamicDialog uses the Dialog component internally, visit <NuxtLink to="/dialog">dialog</NuxtLink> for more information.</p>
</DocSectionText>
2023-02-28 17:40:48 +00:00
<DocSectionCode :code="code" hideToggleCode importCode hideCodeSandbox hideStackBlitz />
2023-02-28 08:29:30 +00:00
</template>
<script>
export default {
data() {
return {
code: {
2023-08-16 13:58:31 +00:00
basic: `import { markRaw } from 'vue';
2023-02-28 08:29:30 +00:00
import ProductListDemo from './ProductListDemo';
2023-03-13 12:36:33 +00:00
import FooterDemo from './FooterDemo';
2023-02-28 08:29:30 +00:00
export default {
methods:{
showProducts() {
const dialogRef = this.$dialog.open(ProductListDemo, {
props: {
header: 'Product List',
style: {
width: '50vw',
},
breakpoints:{
'960px': '75vw',
'640px': '90vw'
},
modal: true
},
templates: {
2023-03-13 12:36:33 +00:00
footer: markRaw(FooterDemo)
2023-02-28 08:29:30 +00:00
},
onClose: (options) => {
const data = options.data;
if (data) {
this.$toast.add({ severity:'info', summary: 'Info Message', detail:'Order submitted', life: 3000 });
}
}
});
}
}
}`
}
};
}
};
</script>