File tree Expand file tree Collapse file tree 3 files changed +20
-28
lines changed Expand file tree Collapse file tree 3 files changed +20
-28
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <transition :name =" props.fade ? 'fade' : null" appear >
2
+ <transition :name =" props.fade ? 'fade' : null" : appear= " true " >
3
3
<div
4
- v-show =" isShowed"
5
- : class =" toastClasses "
4
+ v-if =" isShowed"
5
+ class =" toast "
6
6
role =" alert"
7
7
aria-live =" assertive"
8
8
aria-atomic =" true"
@@ -48,30 +48,21 @@ export default {
48
48
},
49
49
data () {
50
50
return {
51
- isShowed: false ,
51
+ isShowed: this . show ,
52
52
hidding: false ,
53
53
timeout: null ,
54
54
hiddingTimeout: null
55
55
}
56
56
},
57
57
watch: {
58
- show (val ) {
59
- val ? this .display () : this .close ()
58
+ show: {
59
+ immediate: true ,
60
+ handler (val ) {
61
+ val ? this .display () : this .close ()
62
+ }
60
63
}
61
64
},
62
- // needed not to be called in show watcher to allow SSR
63
- mounted () {
64
- this .show ? this .display () : this .close ()
65
- },
66
65
computed: {
67
- toastClasses () {
68
- return [
69
- ' toast' ,
70
- {
71
- ' show' : this .isShowed ,
72
- }
73
- ]
74
- },
75
66
directlyDeclaredProps () {
76
67
return Object .keys (this .$options .propsData )
77
68
},
@@ -94,8 +85,9 @@ export default {
94
85
this .$nextTick (() => {
95
86
if (this .props .autohide ) {
96
87
this .setAutohide ()
88
+ } else if (this .hidding === true ) {
89
+ this .finishHidding ()
97
90
}
98
- this .finishHidding ()
99
91
})
100
92
},
101
93
close (restoreOnHover = false ) {
@@ -148,6 +140,9 @@ export default {
148
140
</script >
149
141
150
142
<style scoped>
143
+ .toast {
144
+ opacity : inherit ;
145
+ }
151
146
.fade-enter-active {
152
147
transition : opacity .5s ;
153
148
}
Original file line number Diff line number Diff line change 2
2
3
3
exports [` CToast renders correctly 1` ] = `
4
4
<div
5
- appear = " "
5
+ appear = " true "
6
6
aria-atomic = " true"
7
7
aria-live = " assertive"
8
- class = " toast show "
8
+ class = " toast"
9
9
position = " static"
10
10
role = " alert"
11
- style = " "
12
11
>
13
12
<!---->
14
13
@@ -20,14 +19,13 @@ exports[`CToast renders correctly 1`] = `
20
19
21
20
exports [` CToast renders correctly custom wrapper 1` ] = `
22
21
<div
23
- appear = " "
22
+ appear = " true "
24
23
aria-atomic = " true"
25
24
aria-live = " assertive"
26
- class = " toast show "
25
+ class = " toast"
27
26
name = " fade"
28
27
position = " bottom-center"
29
28
role = " alert"
30
- style = " "
31
29
>
32
30
<div
33
31
class = " toast-header"
Original file line number Diff line number Diff line change @@ -11,12 +11,11 @@ exports[`CToaster renders correctly custom wrapper 1`] = `
11
11
class = " toaster toaster-top-left"
12
12
>
13
13
<div
14
- appear = " "
14
+ appear = " true "
15
15
aria-atomic = " true"
16
16
aria-live = " assertive"
17
- class = " toast show "
17
+ class = " toast"
18
18
role = " alert"
19
- style = " "
20
19
>
21
20
<!---->
22
21
You can’t perform that action at this time.
0 commit comments