1.9.5 • Published 6 years ago

vue-tabbar-slide v1.9.5

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

vue-tabbar-slide

A Vue.js Slide Tab-bar

image

Install

npm install vue-tabbar-slide -S

How To Use

//main.js
import Vue from 'vue'
import vueTabbarSlide from 'vue-tabbar-slide'

Vue.use(vueTabbarSlide)
  <!-- app.vue -->
  <template>
    <div id="app">
      <vue-tabbar-slide :options="options" @callback="callback"></vue-tabbar-slide>

      <div @click="getData">点击获取数据</div>
      <div @click="getData1">点击更改数据</div>
    </app>
  </template>
  <script>
    export default {
      name: 'app',
      data () {
        return {
          options: {
            //required(必填项)
            container: 'mySlide1',
            slideData: [],
              //用来传递data-id
            slideId: [],
            //optional(可选项)
            width: '80px',
            index: 1
          },
        }
      },
      methods: {
        getData () {
          this.options.slideData = ['data1', 'data2', 'data3', 'data4', 'data5', 'data6', 'data7', 'data8', 'data9', 'data10']
          this.options.slideId = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
        },
        getData1 () {
          this.options.slideData = ['data11', 'data21', 'data31', 'data41', 'data51', 'data61']
          this.options.slideId = ['11', '21', '31', '41', '51', '61', '71', '81', '91', '101']
        },
        callback (event, index, val, id) {
          console.log(`callback=${index},${val},${id}`)
        }
      }
    }
  </script>

options

NameTypeDefaultDescription
required
containerString---container name
slideDataArray---data
slideIdArray---data-id
optional
indexNumber0default index
widthString80pxslide width
heightString40pxslide height
textAlignStringcentertext-align
fontSizeString14pxfont-size
fontFamilyStringMicrosoft YaHeifont-family
colorString#333font-color
checkedColorString#00a0e9checked-color
downLineHeightString2pxunderline height
downLineColorString#00a0e9underline color

update

Solve the problem when the number of slide is insufficient

Extension usage

image

you can use it to make a N-linkage and so on

####### if you find some questions, please contact me!

bling_faker@163.com

if you like it, show me your star, thanks very much

1.9.5

6 years ago

1.9.4

6 years ago

1.9.3

6 years ago

1.9.2

6 years ago

1.9.1

6 years ago

1.9.0

6 years ago

1.8.0

6 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago