vir-ui-tab

1.3.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i vir-ui-tab

Weekly Downloads

0

Version

1.3.0

License

MIT

Last publish

Collaborators

  • cjg