File tree Expand file tree Collapse file tree 4 files changed +23
-7
lines changed
packages/bootstrap-vue-3/src Expand file tree Collapse file tree 4 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to this project will be documented in this file. See [ standard-version] ( https://github.com/conventional-changelog/standard-version ) for commit guidelines.
4
4
5
+ ## [ 0.1.20] ( https://github.com/cdmoro/bootstrap-vue-3/compare/v0.1.19...v0.1.20 ) (2022-07-21)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * propagate ` delay ` as a component prop ([ 21dfc79] ( https://github.com/cdmoro/bootstrap-vue-3/commit/21dfc79c8eac60a8e315488013c381ffe5f3facb ) )
11
+
5
12
## [ 0.1.19] ( https://github.com/cdmoro/bootstrap-vue-3/compare/v0.1.18...v0.1.19 ) (2022-07-13)
6
13
7
14
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import {BLINK_PROPS} from '../BLink/BLink.vue'
19
19
import {BodyProp } from ' ./plugin'
20
20
21
21
export const SLOT_NAME_TOAST_TITLE = ' toast-title'
22
- const MIN_DURATION = 5000
22
+ const MIN_DURATION = 1000
23
23
24
24
export default defineComponent ({
25
25
props: {
Original file line number Diff line number Diff line change 5
5
:id =" toast.options.id"
6
6
:key =" toast.options.id"
7
7
v-model =" toast.options.value"
8
+ :delay =" toast.options.delay"
8
9
:title =" toast.content.title"
9
10
:body =" toast.content.body"
10
11
:component =" toast.content.body"
Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
1
2
import { Directive , DirectiveBinding } from 'vue'
2
3
import Tooltip from 'bootstrap/js/dist/tooltip'
3
4
@@ -64,23 +65,30 @@ const BTooltip: Directive<HTMLElement> = {
64
65
const trigger = resolveTrigger ( binding . modifiers )
65
66
const placement = resolvePlacement ( binding . modifiers )
66
67
const delay = resolveDelay ( binding . value )
68
+ const title = el . getAttribute ( 'title' )
67
69
68
70
new Tooltip ( el , {
69
71
trigger,
70
72
placement,
71
73
delay,
72
74
html : isHtml ,
73
75
} )
76
+
77
+ if ( title ) {
78
+ el . setAttribute ( 'data-bs-original-title' , title )
79
+ }
74
80
} ,
75
81
updated ( el ) {
76
82
const title = el . getAttribute ( 'title' )
83
+ const originalTitle = el . getAttribute ( 'data-bs-original-title' )
84
+ const instance = Tooltip . getInstance ( el )
85
+
86
+ el . removeAttribute ( 'title' )
77
87
78
- if ( title !== '' ) {
79
- const instance = Tooltip . getInstance ( el )
80
- instance ?. toggle ( )
81
- el . setAttribute ( 'data-bs-original-title' , title || '' )
82
- el . setAttribute ( 'title' , '' )
83
- instance ?. toggle ( )
88
+ if ( title && title !== originalTitle ) {
89
+ // @ts -ignore
90
+ instance ?. setContent ( { '.tooltip-inner' : title } )
91
+ el . setAttribute ( 'data-bs-original-title' , title )
84
92
}
85
93
} ,
86
94
unmounted ( el ) {
You can’t perform that action at this time.
0 commit comments