Skip to content

Commit 24110d0

Browse files
committed
feat(BToast): Add options autoHide, noCloseButton.
Allow to display or not the close button, and set a toast message with no auto hide
1 parent 36d86a3 commit 24110d0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/bootstrap-vue-3/src/components/BToast/BToaster.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
:id="toast.options.id"
66
:key="toast.options.id"
77
v-model="toast.options.value"
8+
:auto-hide="toast.options.autoHide"
89
:delay="toast.options.delay"
10+
:no-close-button="toast.options.noCloseButton"
911
:title="toast.content.title"
1012
:body="toast.content.body"
1113
:component="toast.content.body"

packages/bootstrap-vue-3/src/components/BToast/plugin.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ export interface ToastContent {
1919
}
2020

2121
export interface ToastOptions {
22-
id?: string
23-
value?: boolean // show or hide
22+
autoHide?: boolean
2423
delay?: number
24+
id?: string
25+
noCloseButton?: boolean
2526
pos?: ContainerPosition
27+
value?: boolean // show or hide
2628
variant?: ColorVariant
2729
}
2830

@@ -50,7 +52,7 @@ interface ToastContainers {
5052
[key: symbol]: ToastVM
5153
}
5254

53-
const defaultToastOptions: ToastOptions = {delay: 5000, value: true, pos: 'top-right'}
55+
const defaultToastOptions: ToastOptions = {autoHide: true, delay: 5000, noCloseButton: false, pos: 'top-right', value: true}
5456

5557
export class ToastInstance {
5658
vm: ToastVM

0 commit comments

Comments
 (0)