1 Star 0 Fork 36

zhgf / vue-tab

forked from alex qian / vue-tab 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
alex qian 提交于 2018-01-22 22:49 . Update README.md

Vue-Tabs

npm

A Vue.js tabs framework replacing the URL-ROUTER for Vue2.0 (多tab页轻型框架,在多tab系统中替代路由)

Demo

查看 DEMO

image

Usage

Step1. config

// tabs.js
// config
import Hello from './components/Hello'
export default [{
    name: 'home', // name UNIQUE
    title: '首页', // tab's title
    component: Hello
}, {
    name: 'test1',
    title: '测试1',
    component: {
        template: '<h2>测试1</h2>'
    }
}]

Step2. New instance & use

import VueTaber from 'vue-tabs'
import '../vue-tabs.css'
import tabs from './tabs.js'

const vueTaber = new VueTaber({
    tabs
})

Vue.use(VueTaber)
new Vue({
    el: '#app',
    taber: vueTaber,
    template: '<App/>',
    components: {
        App
    }
})

Step3. Html Element

<div id="app">
<vue-tabs></vue-tabs>
</div>

Step4. Use api to open a tab

this.$taber.open({
    name: item.name
})

Contributing

Contributing

JavaScript
1
https://gitee.com/zhgf01/vue-tab.git
git@gitee.com:zhgf01/vue-tab.git
zhgf01
vue-tab
vue-tab
master

搜索帮助