You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
925 B
925 B
代码演示
基础用法
通过list
展示分段器的标题名称。
<hd-section :list="list"></hd-section>
const list = ref<string[]>(['简介', '详情', '评论', '打赏']) // 或者[{name: '简介'}, {name: '详情'}, {name: '评论'}, {name: '打赏'}]
自定义组件颜色
当不设置mode
或者mode=button
时,通过buttonColor
设置滑块背景颜色,通过bgColor
设置组件背景颜色。
<hd-section :list="list" buttonColor="#999" bgColor="#f3f4f5"></hd-section>
切换动画效果
animation
控制是否存在滚动动画切换,默认存在动画true
。
<hd-section :list="list" :animation="false"></hd-section>
切换振动效果
当作用于微信小程序时,通过设置vibrateShort
,在切换时使手机产生短促振动。
<hd-section :list="list" :vibrateShort="true"></hd-section>