2.0.0 • Published 6 years ago

vue-slide-tab v2.0.0

Weekly downloads
13
License
ISC
Repository
github
Last release
6 years ago

vue-slide-tab

mobile tab component use vue2

install

npm i vue-slide-tab

demo

run local serve to check the demo or check online

npm run start

usage

// main.js
import VueSlideTab from 'vue-slide-tab'
// use as plugin
Vue.use(VueSlideTab)
// use as component
Vue.component('VueSlideTab', VueSlideTab.component)

// sfc.vue
<template>
  <VueSlideTab :tabs="tabs" :current="cur" @tabClick="tabClick">
    <template v-slot:tab="{ tab, index }">
      <div :class="[cur === index ? 'active' : '', 'list-tab']">{{ `tab:${tab.name}` }}</div>
    </template>
  </VueSlideTab>
</template>

props

PropertyTypeRequired?Description
tabsArrayyestab data array
currentNumberyescurrent tab index start from 0
dirStringnotext direction

events

  • tabClick: emit when tab clicked, receive clicked tab index
2.0.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago