appApplet/components/function-list/swiper-gong-ge/readme.md

1.9 KiB
Raw Permalink Blame History

第一步:引入组件

import swiperGongGe from '@/components/function-list/swiper-gong-ge/swiper-gong-ge.vue';

第二步:注册组件

export default {
	components:{
		swiperGongGe
	}
}

第三步:使用组件

<template>
	<view>
		<swiper-gong-ge @chooseGe="chooseGe"></swiper-gong-ge>
	</view>
</template>

参数说明

list列表数据默认以下数组
[
	[
		{url:'',iconsrc:'/static/tabbar/icon-select-person.png',iconWidth:60,iconHeight:60,title:'标题一'},
		{url:'',iconsrc:'/static/tabbar/icon-select-fun.png',iconWidth:60,iconHeight:60,title:'标题二'},
		{url:'',iconsrc:'/static/tabbar/icon-select-home.png',iconWidth:60,iconHeight:60,title:'标题三'},
		{url:'',iconsrc:'/static/tabbar/icon-select-news.png',iconWidth:60,iconHeight:60,title:'标题四'},
		{url:'',iconsrc:'/static/tabbar/icon-select-news.png',iconWidth:60,iconHeight:60,title:'标题四'},
		{url:'',iconsrc:'/static/tabbar/icon-select-news.png',iconWidth:60,iconHeight:60,title:'标题四'},
	],
	[
		{url:'',iconsrc:'/static/tabbar/icon-select-person.png',iconWidth:60,iconHeight:60,title:'标题一'},
		{url:'',iconsrc:'/static/tabbar/icon-select-fun.png',iconWidth:60,iconHeight:60,title:'标题二'},
		{url:'',iconsrc:'/static/tabbar/icon-select-home.png',iconWidth:60,iconHeight:60,title:'标题三'},
		{url:'',iconsrc:'/static/tabbar/icon-scan.png',iconWidth:60,iconHeight:60,title:'标题五'},
	]
]
ifAutoplay是否自动轮播默认false
rowNum一排显示数量默认5
titlec标题颜色默认#000000
fonts字体大小默认28rpx
titleTop字体距离图标的距离默认20rpx
itemTopitem的顶部距离默认30rpx
activeStop选中时指示点的颜色默认rgba(0,0,0,1)
moStop未选中时指示点的颜色默认rgba(0,0,0,.2)

方法使用

export default {
	methods:{
		chooseGe(obj) {
			console.log(obj);
		},
	}
}