0.1.1 • Published 4 years ago

jmhc-tabbar v0.1.1

Weekly downloads
8
License
-
Repository
github
Last release
4 years ago

介绍

一款基于uniapp的简易tabBar组件

使用方式

引用组件

npm install jmhc-tabbar
import jmhcTabbar from "jmhc-tabbar"
Vue.use(jmhcTabbar)

使用组件

<jmhc-tabbar :list='list' :midButton="midButton" :tabbarStyle="tabbarStyle"></jmhc-tabbar>
export default {
	data() {
		return {
			midButton:true,
			tabbarStyle:{
				height:'60px',
				boxShadow:' 0 -1px 6px red'
			},
			list: [
				{
					hasBadge: false,
					pagePath: '/pages/index/index2',
					text: 'ss', 
					iconPath: '../../static/fuwu1.png', 
					selectedIconPath: '../../static/fuwu2.png'
				},
				{
					hasBadge: true,
					pagePath: '/pages/index/index', 
					text: 'ss', 
					iconPath: '../../static/fuwu1.png', 
					selectedIconPath: '../../static/fuwu2.png' 
				},
			]
		}
	},
}

属性说明

属性类型默认值说明是否必填
listArraytabbar数据数组yes
midButtonBooleanfalse是否突起(仅在list为奇数时有效)
tabbarStyleObjecttabbar样式(支持css所有样式)
circleStyleObject凸起圆的样式(如下)
textStyleObjectlist中文本样式(如下)
imgStyleObject图片样式(如下)
badgeStyleObject角标样式(支持css所有样式)

list属性说明:

属性类型说明
badgeNumber如果有角标传入角标的值,没有不写该参数
pagePathString'/pages/index/index2'页面路径,必须在 pages .json中先定义
textString"ssss"tab按钮上文字
iconPathString'../../static/fuwu1.png'图片路径
selectedIconPathString'../../static/fuwu2.png'选中时图片途径

circleStyle属性说明:

属性类型说明
topString'10px'相对于tabbar的位置(还包括right,left,bottom,translate等与位置相关的)
widthString‘50px’凸起圆的宽度(还包括height)
boxShadowString'0 -1px 6px black'突起的阴影

textStyle属性说明:

属性类型说明
colorString'black'文本颜色
selectedColorString‘green’选中时文本的颜色
fontSizeNumber16字体大小
paddingTopNumber1文字与图片的距离

imgStyle属性说明:

属性类型说明
imgWidthNumber21图片宽度
imgHeightNumber21图片高度
midWidthNumber51突起图片的宽度
midHeightNumber51突起图片的高度