diff --git a/src/components/toast/Toast.vue b/src/components/toast/Toast.vue index 90b88f93e..3025e0c44 100755 --- a/src/components/toast/Toast.vue +++ b/src/components/toast/Toast.vue @@ -2,7 +2,7 @@
- +
diff --git a/src/components/toast/ToastMessage.vue b/src/components/toast/ToastMessage.vue index ed1cb245a..b7c3ef8d0 100755 --- a/src/components/toast/ToastMessage.vue +++ b/src/components/toast/ToastMessage.vue @@ -1,11 +1,14 @@ @@ -351,6 +400,15 @@ export default { this.$toast.add({severity:'info', summary:'Message 2', detail:'Message 2 Content', life: 3000}); this.$toast.add({severity:'info', summary:'Message 3', detail:'Message 3 Content', life: 3000}); }, + showTemplate() { + this.$toast.add({severity: 'warn', summary: 'Are you sure?', detail: 'Proceed to confirm', group: 'bc'}); + }, + onConfirm() { + this.$toast.removeGroup('bc'); + }, + onReject() { + this.$toast.removeGroup('bc'); + }, clear() { this.$toast.removeAllGroups(); } @@ -382,6 +440,26 @@ button { + + + +
Severities
@@ -441,12 +522,21 @@ export default defineComponent({ toast.add({severity:'info', summary:'Message 2', detail:'Message 2 Content', life: 3000}); toast.add({severity:'info', summary:'Message 3', detail:'Message 3 Content', life: 3000}); } + const showTemplate = () => { + toast.add({severity: 'warn', summary: 'Are you sure?', detail: 'Proceed to confirm', group: 'bc'}); + } + const onConfirm = () => { + toast.removeGroup('bc'); + } + const onReject = () => { + toast.removeGroup('bc'); + } const clear = () => { toast.removeAllGroups(); } return { showSuccess, showInfo, showWarn, showError, showTopLeft, showBottomLeft, - showBottomRight, showSticky, showMultiple, clear }; + showBottomRight, showSticky, showMultiple, showTemplate, onConfirm, onReject, clear }; } }); <\\/script>