更新记录
1.0.2(2024-01-07) 下载此版本
组件优化
1.0.1(2023-07-25) 下载此版本
组件优化
1.0.0(2023-07-25) 下载此版本
组件初始化
查看更多平台兼容性
Vue2 | Vue3 |
---|---|
√ | √ |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
HBuilderX 3.1.0 app-vue app-nvue | √ | √ | √ | √ | √ | √ |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 |
---|---|---|---|
√ | √ | √ | √ |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | √ | √ | √ |
cc-nav-swiper
我的技术微信公众号
查看更多前端组件和框架信息,请关注我的技术微信公众号【前端组件开发】
使用方法
<!-- list:数据 rowCount:行数 columnCount:列数 @itemClick:条目点击事件 -->
<cc-nav-swiper :list="cateNavs" :rowCount="2" :columnCount="5" @itemClick="itemClick"></cc-nav-swiper>
// 数据设置
cateNavs: [{
url: '',
image: '/static/mock/index/cate-nav/domestic-appliance.png',
title: '家用电器',
},
{
url: '',
image: '/static/mock/index/cate-nav/electronics.png',
title: '数码电器',
},
{
url: '',
image: '/static/mock/index/cate-nav/exchange.png',
title: '以旧换新',
}, {
url: '',
image: '/static/mock/index/cate-nav/clothes.png',
title: '服饰',
},
{
url: '',
image: '/static/mock/index/cate-nav/coupon.png',
title: '优惠券',
},
{
url: '',
image: '/static/mock/index/cate-nav/fees.png',
title: '充值缴费',
},
{
url: '',
image: '/static/mock/index/cate-nav/fruits.png',
title: '水果生鲜',
},
{
url: '',
image: '/static/mock/index/cate-nav/import.png',
title: '进口国际',
},
{
url: '',
image: '/static/mock/index/cate-nav/market.png',
title: '超市',
},
{
url: '',
image: '/static/mock/index/cate-nav/medicine.png',
title: '医药',
},
{
url: '',
image: '/static/mock/index/cate-nav/pet.png',
title: '萌宠',
},
{
url: '',
image: '/static/mock/index/cate-nav/travel.png',
title: '旅行',
},
{
url: '',
image: '/static/mock/index/cate-nav/vip.png',
title: '会员',
},
{
url: '',
image: '/static/mock/index/cate-nav/more.png',
title: '更多',
}
],
//事件处理 条目点击
itemClick(item){
uni.showModal({
title:'点击条目数据',
content: '点击条目数据 = ' + JSON.stringify(item)
})
}
HTML代码实现部分
<template>
<view class="page">
<view style="height: 60px;"></view>
<!-- list:数据 rowCount:行数 columnCount:列数 @itemClick:条目点击事件 -->
<cc-nav-swiper :list="cateNavs" :rowCount="2" :columnCount="5" @itemClick="itemClick"></cc-nav-swiper>
</view>
</template>
<script>
export default {
data() {
return {
cateNavs: [{
url: '',
image: '/static/mock/index/cate-nav/domestic-appliance.png',
title: '家用电器',
},
{
url: '',
image: '/static/mock/index/cate-nav/electronics.png',
title: '数码电器',
},
{
url: '',
image: '/static/mock/index/cate-nav/exchange.png',
title: '以旧换新',
}, {
url: '',
image: '/static/mock/index/cate-nav/clothes.png',
title: '服饰',
},
{
url: '',
image: '/static/mock/index/cate-nav/coupon.png',
title: '优惠券',
},
{
url: '',
image: '/static/mock/index/cate-nav/fees.png',
title: '充值缴费',
},
{
url: '',
image: '/static/mock/index/cate-nav/fruits.png',
title: '水果生鲜',
},
{
url: '',
image: '/static/mock/index/cate-nav/import.png',
title: '进口国际',
},
{
url: '',
image: '/static/mock/index/cate-nav/market.png',
title: '超市',
},
{
url: '',
image: '/static/mock/index/cate-nav/medicine.png',
title: '医药',
},
{
url: '',
image: '/static/mock/index/cate-nav/pet.png',
title: '萌宠',
},
{
url: '',
image: '/static/mock/index/cate-nav/travel.png',
title: '旅行',
},
{
url: '',
image: '/static/mock/index/cate-nav/vip.png',
title: '会员',
},
{
url: '',
image: '/static/mock/index/cate-nav/more.png',
title: '更多',
}
],
}
},
methods: {
// 条目点击
itemClick(item){
uni.showModal({
title:'点击条目数据',
content: '点击条目数据 = ' + JSON.stringify(item)
})
}
},
}
</script>
<style lang="scss" scoped>
</style>