# vue-layout-tab

> ## usage

Latest version **0.1.3** (published 2019-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-layout-tab
pnpm add vue-layout-tab
yarn add vue-layout-tab
bun add vue-layout-tab
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2019-04-01 |
| First published | 2019-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 201.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | falstack |
| Maintainers | falstack |
| Keywords | vue, layout, tab |

## Links

- npm: https://www.npmjs.com/package/vue-layout-tab
- Homepage: https://github.com/falstack/vue-layout-tab
- Issues: https://github.com/falstack/vue-layout-tab/issues
- npm.io page: https://npm.io/package/vue-layout-tab

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.6
- [better-scroll](https://npm.io/package/better-scroll.md) ^1.15.1

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2019-04-01
- 0.1.2 — 2019-03-29
- 0.1.1 — 2019-03-29
- 0.1.0 — 2019-03-29

## README

# vue-layout-tab

## usage

### install
```shell
yarn add vue-layout-tab
```

### example
```vue
<v-tab :headers="headers">
  <template slot="0">
    <VueScroll>
      建议使用 better-scroll
    </VueScroll>
  </template>
  <template slot="1">
    <p>非 routable 模式下，template 个数与 headers 的长度相同</p>
  </template>
</v-tab>
```
### args
| name | type | default  | required | meaning |
| --- | --- | --- | --- | --- |
| headers | <Array> | [] | Y | tab-header 的数组，支持 icon |
| default-index | <Number> | 0 | N | 默认选中的 tab index |
| routable | <Boolean> | false | N | 设为 true 则为路由模式 |
| animated | <Boolean> | false | N | 是否支持切换动画 | 
| duration | <Number> | 300 | N | 切换动画的时长，ms |
| align | <String> | around | N | tab 的展示模式 ['around', 'start', 'center', 'end'] |
| swipe | <Boolean> | false | N | 是否支持左右手势滑动 | 
| sticky | <Boolean> | false | N | 是否让 tab-header 吸附在页面顶部 |


### tips
1. tab 较多时建议`align：start`
2. `swipe: true`的时候建议使用`better-scroll`
3. 使用`better-scroll`的使用，建议`sticky: true`
4. `headers`可以是字符串数组，也可以是对象数组，`routable: true`时，使用对象数组，每个tab有`route`属性，为指向页面的`name`
5. `routable：true`的时候，不需要`<template slot>`

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn run serve
```

### Compiles and minifies for production
```
yarn run build
```

### Lints and fixes files
```
yarn run lint
```

---
_Source: https://npm.io/package/vue-layout-tab · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
