Merge pull request #136 from Zboru/tab-pane-click

Add @click for TabPane component
This commit is contained in:
Ilya Artamonov
2023-06-04 12:47:26 +03:00
committed by GitHub
2 changed files with 35 additions and 2 deletions

View File

@@ -127,3 +127,32 @@ defineProps({
},
})
```
## Tab pane interaction
You can add `@click:pane` to Tabs component to intercept click on tab pane.
```vue
<script setup>
import { ref } from 'vue'
import { Tabs, Tab } from 'flowbite-vue'
function handlePaneClick(): void {
console.log("Click!")
}
</script>
<template>
<tabs variant="pills" v-model="activeTab" class="p-5" @click:pane="handlePaneClick">
<tab name="first" title="First">
Lorem...
</tab>
<tab name="second" title="Second">
Lorem...
</tab>
<tab name="third" title="Third">
Lorem...
</tab>
<tab name="fourth" title="Fourth" :disabled="true">
Lorem...
</tab>
</tabs>
</template>
```