adds on:select handler to tabs component

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-15 15:39:00 +02:00
parent 9f0f04c8d3
commit e12808e3a2
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<script>
import "@spectrum-css/tabs/dist/index-vars.css"
import { writable } from 'svelte/store'
import { onMount, setContext } from 'svelte'
import { onMount, setContext, createEventDispatcher } from 'svelte'
export let selected;
export let vertical = false
@ -11,7 +11,10 @@
let container;
const dispatch = createEventDispatcher()
$: selected = $tab.title
$: selected = dispatch('select', selected)
let top, left, width, height;
$: calculateIndicatorLength($tab)