|
@@ -23,7 +23,7 @@ export default defineComponent({
|
|
|
time: null as any
|
|
|
});
|
|
|
const init = () => {
|
|
|
- if (notiData.isActive) return;
|
|
|
+ if (notiData.isActive || !contentRef.value || !wrapRef.value) return;
|
|
|
notiData.isActive = true;
|
|
|
notiData.contentWidth = contentRef.value.getBoundingClientRect().width;
|
|
|
notiData.wrapWidth = wrapRef.value.getBoundingClientRect().width;
|
|
@@ -43,8 +43,8 @@ export default defineComponent({
|
|
|
notiData.contentStyle.transitionDuration = '0s';
|
|
|
notiData.contentStyle.transform = `translateX(${notiData.wrapWidth}px)`;
|
|
|
requestAnimationFrame(() => {
|
|
|
- startAnimate();
|
|
|
- })
|
|
|
+ startAnimate();
|
|
|
+ });
|
|
|
}, 5 * 1000);
|
|
|
};
|
|
|
const stopAnimate = () => {
|