效果图

VUE组件封装
<template>
<div class="marquee" :style="{ backgroundColor: bgColor, height: height + 'px' }">
<span class="marquee__title" ref="marqueeTitle" :style="{ color, fontSize: fontSize + 'px', animationDuration: speed + 's', '--speed': speed }" v-html="title"></span>
</div>
</template>
<script>
/**
* NoticeBar 公告栏跑马灯
* @description 从右往左的跑马灯
* @property {String} content 显示的内容,支持html
* @property {String} color 文字颜色,默认#EFF0DB
* @property {Number} fontSize 文字大小,默认40
* @property {Number} speed 滚动速度,单位s(播放一次所用时间,默认根据内容宽度计算时间)
* @property {String} bgColor 背景颜色,默认#CC2529
* @property {Number} height 背景高度,默认78
*/
export default {
name: 'NoticeBar',
props: {
content: {
type: String,
default: ''
},
color: {
type: String,
default: '#EFF0DB'
},
fontSize: {
type: Number,
default: 40

&spm=1001.2101.3001.5002&articleId=128671773&d=1&t=3&u=d61144973170455abfdb2df670f41086)
5800

被折叠的 条评论
为什么被折叠?



