yarn add vue-slim-tabs
<template>
<tabs>
<tab title="Vue">
This is Vue
</tab>
<tab title="React">
This is React
</tab>
<tab title="Svelte">
This is Svelte
</tab>
</tabs>
</template>
<script>
import { Tabs, Tab } from 'vue-slim-tabs'
export default {
components: {
Tabs, Tab
}
}
</script>
<!-- optionally use our default style -->
<style src="https://github.com/egoist/vue-slim-tabs/raw/master/vue-slim-tabs/themes/default.css"></style>
You can use it as a plugin if you don't mind registering components globally:
import * as Tabs from 'vue-slim-tabs'
Vue.use(Tabs)
<Tabs>
Type: Number
Default: 0
Index of selected tab on the first render.
Type: function
Default: undefined
The function to invoke as user selects a tab by clicking:
function onSelect(e, index) {
// e: click event
// index: index of selected tab
}
<Tab>
Type: string
vNode
Required: required unless titleSlot
is set
Use a string or vNode as tab title.
Type: string
Use a slot as the tab title.
Type: Boolean
Default: undefined
Disable relevant tab, i.e. make it unselectable.
Run the example with Poi:
cd vue-slim-tabs
yarn
yarn dev
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
vue-slim-tabs © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoist.moe · GitHub @egoist · Twitter @_egoistlily