|
@@ -19,6 +19,10 @@ export default defineComponent({
|
|
|
isAnimation: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ time: {
|
|
|
+ type: Number,
|
|
|
+ default: 5
|
|
|
}
|
|
|
},
|
|
|
setup(props) {
|
|
@@ -48,7 +52,7 @@ export default defineComponent({
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- notiData.contentStyle.transitionDuration = '5s';
|
|
|
+ notiData.contentStyle.transitionDuration = props.time + 's';
|
|
|
notiData.contentStyle.transform = 'translateX(-100%)';
|
|
|
|
|
|
notiData.time = setTimeout(() => {
|
|
@@ -78,7 +82,7 @@ export default defineComponent({
|
|
|
<div
|
|
|
ref={wrapRef}
|
|
|
class={[styles.wrap, props.isAnimation ? styles.isAnitaion : '']}
|
|
|
- onMouseenter={() => !props.isAnimation && init()}
|
|
|
+ onMouseenter={() => !props.isAnimation && init()}
|
|
|
onMouseleave={() => !props.isAnimation && stopAnimate()}>
|
|
|
<div
|
|
|
ref={contentRef}
|