方式一: css手写实现左右移动字幕
在需要的地方加上 marquee 类名即可
.marquee{
color: #ff5722;
text-align: right;
animation: myMove 5s linear infinite forwards;
}
@keyframes myMove {
0% {
transform: translateX(0%);
}
50% {
transform: translateX(-50%);
}
100% {
transform: translateX(-100%);
}
}
方式二:使用 vue-seamless-scroll
请参考官方链接:https://chenxuan0000.github.io/vue-seamless-scroll/guide/