Metrics
0
Watch 46 Star 111 Fork 27

alex qian / vue-tabJavaScriptApache-2.0

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
Vue 多tab页框架可替代router, https://github.com/alexqdjay/vue-tabs spread retract

Clone or download
Loading...
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

Comments ( 31 )

You need to Sign in for post a comment

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

Help Search