Barrage 弹幕
单实例切换不同弹幕场景,保证动画、循环与点击事件都是实际可运行的。
演示
9:41
代码示例
引入
推荐使用 easycom 模式,配置后无需手动 import 即可直接使用 <re-barrage />。
API
Barrage Props
| 名称 | 类型 | 默认值 | 描述 | 必传 |
|---|---|---|---|---|
| list | Array<UTSJSONObject> | as Array<UTSJSONObject> | - | Y |
| speed | number | 100 | - | Y |
| top | number | 10 | - | Y |
| duration | number | 5000 | - | Y |
| loop | boolean | true | - | Y |
| customStyle | string | '' | 自定义样式 | Y |
Barrage Events
| 名称 | 参数 | 描述 |
|---|---|---|
| click | item: UTSJSONObject | 点击时触发 |
Barrage Slots
| 名称 | 描述 |
|---|---|
| - | - |
