0.0.11 • Published 5 years ago

dwb-vue-tab v0.0.11

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

npm.io npm.io npm.io npm.io

Install

npm i dwb-vue-tab --save

Mount

mount with global

import Vue from 'vue'
import TabBar from 'dwb-vue-tab'

Vue.use(TabBar)

mount with component

import { DwbVueTab } from 'dwb-vue-tab'

export default {
  components: {
    DwbVueTab
  }
}

Props

AttributeTypeDefaultDescription
dataarray[]for data rendered with tab-bar
activenumber,string0the element selected by default, supports the .sync modifier
tabWidthstring'110px'tab-bar width
tabHeightstring'40px'tab-bar height
tabColorstring'#999'tab-bar color
tabStyleobject{}custom style of tab-bar
fontSizestring'14px'font size of tab-bar
fontFamilystring'PingFangSC-Regular'font family of tab-bar
namestring, obejctnullif the data-element is an object, render data with name
backgroundstring'#FFF'tab-bar background
highlightstring'#A5884D'activated the colors shown
activeStyleobject{}activated the style shown
lineUsebooleantrueuse underlining or not
lineHeightstring'2px'underline height
lineWidthstring, objectnullunderline width
lineColorstring'#A5884D'underline color
lineStyleobject{}custom style of underline
initCallbackbooleanfalseinitialize execution callback

Events

AttributeValueDescription
callback(activated element)execute when switching activation elements

Demo

<template>
    <DwbVueTab :data="tabs"
               :active.sync="active"
               :initCallback="initCallback"
               @callback="getData"/>
</template>
<script>
export default {
  data () {
    return {
      tabs: ['Tab', 'Bar'],
      active: 0,
      initCallback: true,
    }
  },
  methods: {
    getData (res) {
      console.log(res)
    }
  }
}
</script>

Example

npm install

npm run dev

[Vue Tab Bar]

[More Example]

Author

[Dengwb]

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago