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 11<template >
2- <transition :name =" props.fade ? 'fade' : null" appear >
2+ <transition :name =" props.fade ? 'fade' : null" : appear= " true " >
33 <div
4- v-show =" isShowed"
5- : class =" toastClasses "
4+ v-if =" isShowed"
5+ class =" toast "
66 role =" alert"
77 aria-live =" assertive"
88 aria-atomic =" true"
@@ -48,30 +48,21 @@ export default {
4848 },
4949 data () {
5050 return {
51- isShowed: false ,
51+ isShowed: this . show ,
5252 hidding: false ,
5353 timeout: null ,
5454 hiddingTimeout: null
5555 }
5656 },
5757 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+ }
6063 }
6164 },
62- // needed not to be called in show watcher to allow SSR
63- mounted () {
64- this .show ? this .display () : this .close ()
65- },
6665 computed: {
67- toastClasses () {
68- return [
69- ' toast' ,
70- {
71- ' show' : this .isShowed ,
72- }
73- ]
74- },
7566 directlyDeclaredProps () {
7667 return Object .keys (this .$options .propsData )
7768 },
@@ -94,8 +85,9 @@ export default {
9485 this .$nextTick (() => {
9586 if (this .props .autohide ) {
9687 this .setAutohide ()
88+ } else if (this .hidding === true ) {
89+ this .finishHidding ()
9790 }
98- this .finishHidding ()
9991 })
10092 },
10193 close (restoreOnHover = false ) {
@@ -148,6 +140,9 @@ export default {
148140 </script >
149141
150142<style scoped>
143+ .toast {
144+ opacity : inherit ;
145+ }
151146 .fade-enter-active {
152147 transition : opacity .5s ;
153148 }
Original file line number Diff line number Diff line change 22
33exports [` CToast renders correctly 1` ] = `
44<div
5- appear = " "
5+ appear = " true "
66 aria-atomic = " true"
77 aria-live = " assertive"
8- class = " toast show "
8+ class = " toast"
99 position = " static"
1010 role = " alert"
11- style = " "
1211>
1312 <!---->
1413
@@ -20,14 +19,13 @@ exports[`CToast renders correctly 1`] = `
2019
2120exports [` CToast renders correctly custom wrapper 1` ] = `
2221<div
23- appear = " "
22+ appear = " true "
2423 aria-atomic = " true"
2524 aria-live = " assertive"
26- class = " toast show "
25+ class = " toast"
2726 name = " fade"
2827 position = " bottom-center"
2928 role = " alert"
30- style = " "
3129>
3230 <div
3331 class = " toast-header"
Original file line number Diff line number Diff line change @@ -11,12 +11,11 @@ exports[`CToaster renders correctly custom wrapper 1`] = `
1111 class = " toaster toaster-top-left"
1212>
1313 <div
14- appear = " "
14+ appear = " true "
1515 aria-atomic = " true"
1616 aria-live = " assertive"
17- class = " toast show "
17+ class = " toast"
1818 role = " alert"
19- style = " "
2019 >
2120 <!---->
2221
You can’t perform that action at this time.
0 commit comments