1.0.5 • Published 6 years ago

vue-swipe-tab-layout v1.0.5

Weekly downloads
27
License
-
Repository
github
Last release
6 years ago

vue-swipe-tab-layout

A vue component that simulate native Android component-tabLayout (一个模仿安卓tabLayout的Vue组件)

Install

npm i -S vue-swipe-tab-layout

Usage

swipe-tab-container Attributes

参数说明类型可选值默认值
owner当前组件的拥有者,可以设置为所在的路由页面或者父组件String-''
tabNavListtab-nav 对象列表Array-[]
currentTabIndex当前所在的tab indexNumber-0
indicatorWidthScaleFactornav-indicator的宽度控制因子Number-0.1
swipeTabNavWrapperStyletab-nav的容器的自定义样式Object-{}
swipeTabContentItemStyletab-content的容器的自定义样式Object-{}
fullFlexnav-item是否平分父级宽度Boolean-false

swipe-tab-container event

事件名说明回调参数
tabNavClick单击 nav-item{ event: Event, index: Number, tabNav: Object }
tabNavdblClick双击 nav-item{ event: Event, index: Number, tabNav: Object }

swipe-tab-container slots

for (tabNav of tabNavList) { /* ... */ }
slot名说明
swipe-tab-nav-${tabNav.key}遍历 tabNavList 中的每一个对象,利用key创建slot
swipe-tab-content-${tabNav.key}遍历 tabNavList 中的每一个对象,利用key创建slot

swipe-tab-nav Attributes

参数说明类型可选值默认值
owner当前组件的拥有者,可以设置为所在的路由页面或者父组件String-''
tabLabel显示的内容String-''

swipe-tab-nav slots

name说明
default替换默认的文本

Preview Demo

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run demo

Build Setup

# install dependencies
npm install

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

使用方法

具体请查看 /demo/App.vue

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago