1.3.0 • Published 7 years ago

vir-ui-tab v1.3.0

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

vir-ui-tab

依赖安装

npm

npm install Vir

script 标签

<script src="https://unpkg.com/vir"></script>

安装

npm

npm install vir-ui-tab

script 标签

<script src="https://unpkg.com/vir-ui-tab"></script>
<!-- 全局变量 VirUiTab -->

基本使用

const Tab = require('vir-ui-tab')(
/* 默认值
  {
    index : 0,
    eventType : 'click', // click or mouseover
    navSelector : 'ol > li',
    containerSelector : 'ul > li',
    navCurrentClass : 'cur',
    containerCurrentClass : 'cur'
  }
*/
)

var tab = new Tab({
  el: '.tab'
})
tab.$watch('state', function (result) {
  var index = result.value
  console.log('初始化完成', this.get('index'))
})

tab.$watch('index', function (result) {
  var index = result.value
  this.$$('ul > li').eq(index).html(index)
})



/*
  手动初始化首屏
  tab.set('index', 0, {
    force: true
  })
*/

例子

base tab

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago