更新记录

0.0.02(2022-08-20)

更新colList

0.0.01(2022-08-20)

发布


平台兼容性

Vue2 Vue3
×
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.2.3 app-vue × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × × ×

mxio-scroll-x

当前版本是 vue3+ts,想使用vue2版本请到仓库地址查看

使用方法

属性

属性 类型 默认值 描述
barWidth number 80 滑块宽度
barSHow boolean false 滑块是否展示
dataSource array、slot [] 数据源
column number 5 第一屏展示几列
colList number 5 整个scrollView,你想展示多少列。默认5列,如果想展示单行值为数组长度
scrollItemEmitsClick function - 点击当前元素回调,三个参数(item, index, array)

数据源dataSource

[
    {
        label: '',// 文本
        icon: '',// 图标 ,默认image标签,使用slot可自定义
    }
]

案例

<template>
    <view class="">
        传入dataSource数据源
    </view>
    <view class="" style="padding:20rpx">
        <view class="">
            第一屏4列,单行
        </view>
        <mxio-scroll-x :dataSource="dataSource" :barWidth="barWidth" :colList="11" :column="4" :barShow="barShow" @scrollItemEmitsClick="scrollItemEmitsClick">
        </mxio-scroll-x>
        <view class="">
            第一屏5列,单行
        </view>
        <mxio-scroll-x :dataSource="dataSource" :barWidth="barWidth" :colList="11" :column="5" :barShow="barShow" @scrollItemEmitsClick="scrollItemEmitsClick">
        </mxio-scroll-x>
        <view class="">
            第一屏5列,多行
        </view>
        <mxio-scroll-x :dataSource="dataSource" :barWidth="barWidth" :colList="7" :column="5" :barShow="barShow" @scrollItemEmitsClick="scrollItemEmitsClick">
        </mxio-scroll-x>
    </view>
    <view class="">
        自定义 slot
    </view>
    <view class="" style="padding:20rpx">
        <mxio-scroll-x :barWidth="barWidth" :colList="5" :column="5" :barShow="false" @scrollItemEmitsClick="scrollItemEmitsClick">
            <view v-for="(item, index) in dataSource" :key="index"
                :style="{'background':item.color}"  class="demo-scrollx-item">
                <image src="@/static/logo.png" mode="scaleToFill" class="demo-scrollx-item_img"></image>
                <view class="demo-scrollx-item_txt">{{item.label}}</view>
            </view>
        </mxio-scroll-x>
    </view>
</template>
<style lang="scss" scoped>
    .demo-scrollx-item{
        font-size: 24rpx;
        padding: 24rpx 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: hidden;
        .demo-scrollx-item_img{
            display: block;
            width: 60rpx;
            height: 60rpx;
            margin-bottom: 12rpx;
        }
    }
</style>
  • 会有两个版本
    • vue3+ts
    • vue2

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问