更新记录
1.0.0(2023-04-21)
下载此版本
滚动指示器
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 3.7.13 |
× |
√ |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
jc-scroll-indicator
滚动指示器
支持水平和垂直两个方向,小程序,h5测试通过,其它未测
使用
<script setup>
import { reactive, ref } from "vue";
const list = ref(20)
</script>
<view class="bg-white pb-2 border border-slate-500_30">
<jc-scroll-indicator>
<view class="flex p-2 gap-2">
<view v-for="d in list" :key="d" class="shrink-0 bg-slate-500 text-white w-14 h-14 rounded-lg flex items-center justify-center">{{d}}</view>
</view>
</jc-scroll-indicator>
</view>
<view class="bg-white m-2 pb-2 border border-pink-500_30">
<jc-scroll-indicator>
<view class="flex p-2 gap-2">
<view v-for="d in list" :key="d" class="shrink-0 bg-pink-500 text-white w-14 h-14 rounded-lg flex items-center justify-center">{{d}}</view>
</view>
</jc-scroll-indicator>
</view>
<view class="px-2 font-bold text-base">反转</view>
<view class="bg-white m-2 pt-2 border border-indigo-500_30">
<jc-scroll-indicator :reverse="true" color="RGB(99, 102, 241)">
<view class="flex p-2 gap-2">
<view v-for="d in list" :key="d" class="shrink-0 bg-indigo-500 text-white w-14 h-14 rounded-lg flex items-center justify-center">{{d}}</view>
</view>
</jc-scroll-indicator>
</view>
<view class="px-2 font-bold text-base">自定义</view>
<view class="bg-white m-2 pb-2 border border-teal-500_30">
<jc-scroll-indicator :outWidth="200" :outHeight="20" :width="50" bgColor="lightgreen" color="darkgreen">
<view class="flex p-2 gap-2">
<view v-for="d in list" :key="d" class="shrink-0 bg-teal-500 text-white w-14 h-14 rounded-lg flex items-center justify-center">{{d}}</view>
</view>
</jc-scroll-indicator>
</view>
<view class="px-2 font-bold text-base">Y轴</view>
<view class="bg-white m-2 pb-2 border border-cyan-500_30">
<jc-scroll-indicator :scrollY="true" :gap="20">
<view class="p-2 space-y-2 h-40">
<view v-for="d in list" :key="d" class="bg-cyan-500 text-white h-14 rounded-lg flex items-center justify-center">{{d}}</view>
</view>
</jc-scroll-indicator>
</view>
props
参数 |
类型 |
默认值 |
说明 |
scrollY |
Boolean |
false |
Y轴 |
gap |
Number |
0 |
指示器距离 |
reverse |
Boolean |
false |
是否反转 |
outHeight |
[Number, String] |
8 |
指示器容器高度 dpr = 2 |
outWidth |
[Number, String] |
80 |
指示器容器宽度 dpr = 2 |
width |
[Number, String] |
40 |
指示器宽度 dpr = 2 |
bgColor |
String |
rgba(0, 0, 0, .1) |
指示器背景色 |
color |
String |
- |
指示器颜色 |
slot
emit
事件名称 |
说明 |
scrolltoupper |
滚动到顶部/左边,会触发 scrolltoupper 事件 |
scrolltolower |
滚动到底部/右边,会触发 scrolltolower 事件 |