01 / Overview
cu-promo-barrage
弹幕:多行词条循环滚动,点击单个词条发事件。
氛围
参考件 barrage
1 档
已上线
02 / Demo
档位与实时预览
| 档位数 | 演示页 | 平台 |
|---|---|---|
| 1 | /pages/promo/marketing?name=cu-promo-barrage | App / H5 / 微信 |
右侧的预览由站点脚本把 H5 演示页装进 iframe;切档位与主题在演示页顶部操作,不在此处留静态截图。
03 / Props · Events · Slots
全量契约
props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| words | 弹幕词;空串项过滤掉;过滤后为空 → 不渲染轨道、不起定时器 | Array | [] |
| speed | 速度(px/s);<= 0 → 70 + cuWarn 一次 | Number | 70 |
| lines | 轨道数;取整后夹到 1–3;越界按夹值 + cuWarn 一次 | Number | 2 |
| loop | 是否循环;P0-7 不通过时本 prop 一律按 false(单次滚完即停)+ cuWarn 一次 | Boolean | true |
| itemBg | 词胶囊底色;空串 → 透明底 + 1rpx $promo-border 描边 | String | '' |
events
| 事件 | 说明 | 载荷 |
|---|---|---|
| @action | 点击词条时触发,type 为 click | type, item, index |
slots
| 插槽 | 说明 |
|---|---|
| default | 整卡替换 |
| item | 单词胶囊 |
04 / Example
代码示例
<cu-promo-barrage :words="words" :speed="70" :lines="2" />
05 / Notes
注意事项
点击克隆副本不触发事件。
空词表不渲染轨道、不起定时器。
安装 colorui-promo 全量包与安装任意 cu-promo-* 单件包二选一,不要同时装。单件包的前提是已安装完整 colorui-x。