primevue-mirror/doc/confirmdialog/ConfirmationServiceDoc.vue

36 lines
1.0 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2023-03-08 08:35:24 +00:00
<p>ConfirmDialog is controlled via the <i>ConfirmationService</i> that needs to be installed as an application plugin.</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
2024-01-30 08:16:35 +00:00
<DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz />
2023-03-28 06:38:25 +00:00
<div class="doc-section-description">
2023-10-28 13:59:59 +00:00
<p>The service is available with the <i>useConfirm</i> function for Composition API or using the <i>$confirm</i> property of the application for Options API.</p>
2023-03-28 06:38:25 +00:00
</div>
2024-01-30 08:16:35 +00:00
<DocSectionCode :code="code2" hideToggleCode importCode hideStackBlitz />
2023-02-28 08:29:30 +00:00
</template>
<script>
export default {
data() {
return {
2023-03-28 06:38:25 +00:00
code1: {
2023-09-22 12:54:14 +00:00
basic: `
import {createApp} from 'vue';
2023-02-28 08:29:30 +00:00
import ConfirmationService from 'primevue/confirmationservice';
const app = createApp(App);
2023-09-26 12:14:16 +00:00
app.use(ConfirmationService);
`
2023-03-28 06:38:25 +00:00
},
code2: {
2023-09-22 12:54:14 +00:00
basic: `
import { useConfirm } from "primevue/useconfirm";
2023-03-28 06:38:25 +00:00
2023-09-26 12:14:16 +00:00
const confirm = useConfirm();
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>