Skip to content

seek-bar

[详细示例:progress.vue]

可拖动进度条

属性

参数描述类型
progress当前进度int
secondProgress第二段进度int
maxProgress总进度int
barHeight进度条高度int
thumbWidth滑块宽度int
thumbHeight滑块高度int
backgroundColor总进度条颜色string(#aarrggbb)
progressColor当前进度条颜色string(#aarrggbb)
thumbColor滑块颜色string(#aarrggbb)
listenProgress是否开启监听seek-change回调,默认falseboolean

事件

事件名称描述类型
seek-change当用户拖动进度条时,会执行此回调函数。Function

示例:

点击查看源码
html

<seek-bar
        :focusable="true"
        :maxProgress="100"
        :progress="50"
        :barHeight="6"
        :thumbWidth="35"
        :thumbHeight="35"
        backgroundColor="#40ffffff"
        progressColor="#60ffffff"
        thumbColor="#ffffff"
        :listenProgress="true"
        @seek-change="onSeekChange"
        name="progress"
        @focus="focusChange"
/>
点击查看源码
javascript
onSeekChange(e)
{
    console.log(`seekBar onSeekChange fromUser:${e.fromUser},left:${e.pLeft},right:${e.pRight},state:${e.state}`);
}