0.0.2 • Published 7 years ago

bee-swiper-tab v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

bee-swiper-tab

npm version Build Status Coverage Status devDependency Status NPM downloads Average time to resolve an issue Percentage of issues still open

为多个数据小屏幕中展示量身定做,tab与swiper的结合,多用于表情的展示或者小item的展示。

使用

使用单独的bee-swiper-tab包

组件引入

先进行下载bee-swiper-tab包

npm install --save bee-swiper-tab

组件调用

import Button from 'bee-swiper-tab';
 render(<SwiperTab />,document.getElementById("#app))   

样式引入

  • 可以使用link引入build目录下SwiperTab.css
<link rel="stylesheet" href="./node_modules/bee-swiper-tab/build/SwiperTab.css">
  • 可以在js中import样式
import "./node_modules/bee-swiper-tab/src/SwiperTab.scss"
//或是
import "./node_modules/bee-swiper-tab/build/SwiperTab.css"

API

参数说明类型默认值
titletab标签array"群组1","群组2","群组3"
swiperArray滑动数据array
activeIndextab页签activeIndexnumber0
columnItemNum定义没列swiper的数据放几个itemnumber4
onSelectItem点击选中某个item的回调,返回三个参数(param1:当前tab页签swiper的activeIndex,param2:当前swiper的activeIndex,param3:当前列下第几个)func-
addItem点击添加按钮的回调param1:当前tab页签的activeIndexfunc-
deleteItem点击删除按钮的回调param1:当前tab页签的activeIndexfunc-
onChangeTab切换tab页回调param:切换后的activeIndexfunc-
render自定义的展示出来的item,需要展示哪些字段最多两个(label,img)Function(record)-

开发调试

$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-swiper-tab
$ cd bee-swiper-tab
$ npm install
$ npm run dev