npm install --save ybnav
import YBnav from 'ybnav'
import 'ybnav/dist/ybnav.css'
<link href="ybnav.css" />
<script src="nav.js"></script>
<div class="ybnav-container">
<div class="ybnav-wrapper">
</div>
</div>
var nav = new YBnav(el, options)
- navItem 每个item的类, 如 '.nav-item'
- bounce 是否回弹 boolean值
- clickItem 点击标签的回调方法
- space 每个标签的间隔
- addNav() 添加nav 如:addNav('新标签')
- removeNav(index) 删除指定index的nav,从0开始
- setActive(index) 把第index个设置成acitve,从0开始
- scrollTo(index) 滚动到指定的标签,从0开始