diff --git a/packages/vant/src/barrage/Barrage.tsx b/packages/vant/src/barrage/Barrage.tsx index 7f5b2c7ac..b83bb2061 100644 --- a/packages/vant/src/barrage/Barrage.tsx +++ b/packages/vant/src/barrage/Barrage.tsx @@ -24,7 +24,7 @@ export interface BarrageItem { export const barrageProps = { top: makeNumericProp(10), rows: makeNumericProp(4), - speed: makeNumericProp(4000), + duration: makeNumericProp(4000), autoPlay: truthProp, delay: makeNumberProp(300), modelValue: makeArrayProp(), @@ -55,7 +55,7 @@ export default defineComponent({ item.className = className; item.innerText = String(text); - item.style.animationDuration = `${props.speed}ms`; + item.style.animationDuration = `${props.duration}ms`; item.style.animationDelay = `${delay}ms`; item.style.animationName = 'van-barrage'; item.style.animationTimingFunction = 'linear'; diff --git a/packages/vant/src/barrage/README.md b/packages/vant/src/barrage/README.md index 29acaf15f..75276b444 100644 --- a/packages/vant/src/barrage/README.md +++ b/packages/vant/src/barrage/README.md @@ -2,7 +2,7 @@ ### Intro -To realize the critical subtitle function when watching the video. +To realize the critical subtitle function when watching the video. Please upgrade `vant` to >= v4.4.0 before using this component. ### Install @@ -108,7 +108,7 @@ export default { | auto-play | Whether to play the bullet screen automatically | _boolean_ | `true` | | rows | The number of lines of text | _number \| string_ | `4` | | top | Spacing between the top of the barrage area, unit `px` | _number \| string_ | `10` | -| speed | Speed of passing, unit `ms` | _number \| string_ | `4000` | +| duration | Text animation duration, unit `ms` | _number \| string_ | `4000` | | delay | Barrage animation delay, unit `ms` | _number_ | `300` | ### Methods diff --git a/packages/vant/src/barrage/README.zh-CN.md b/packages/vant/src/barrage/README.zh-CN.md index d8dbbd4ff..0f9ee84d8 100644 --- a/packages/vant/src/barrage/README.zh-CN.md +++ b/packages/vant/src/barrage/README.zh-CN.md @@ -2,7 +2,7 @@ ### 介绍 -实现观看视频时弹出的评论性字幕功能。 +实现观看视频时弹出的评论性字幕功能。请升级 `vant` 到 >= 4.4.0 版本来使用该组件。 ### 引入 @@ -107,14 +107,14 @@ export default { ### Props -| 参数 | 说明 | 类型 | 默认值 | -| --------- | ------------------------------- | ------------------ | ------ | -| v-model | 弹幕数据 | _BarrageItem[]_ | - | -| auto-play | 是否自动播放弹幕 | _boolean_ | `true` | -| rows | 弹幕文字行数 | _number \| string_ | `4` | -| top | 弹幕文字区域顶部间距,单位 `px` | _number \| string_ | `10` | -| speed | 文字滑过容器的时间,单位 `ms` | _number \| string_ | `4000` | -| delay | 弹幕动画延时,单位 `ms` | _number_ | `300` | +| 参数 | 说明 | 类型 | 默认值 | +| --------- | --------------------------------- | ------------------ | ------ | +| v-model | 弹幕数据 | _BarrageItem[]_ | - | +| auto-play | 是否自动播放弹幕 | _boolean_ | `true` | +| rows | 弹幕文字行数 | _number \| string_ | `4` | +| top | 弹幕文字区域顶部间距,单位 `px` | _number \| string_ | `10` | +| duration | 弹幕文字滑过容器的时间,单位 `ms` | _number \| string_ | `4000` | +| delay | 弹幕动画延时,单位 `ms` | _number_ | `300` | ### 方法