adds on:select handler to tabs component

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-15 15:39:00 +02:00
parent f25bebf822
commit 61e1529ea8
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)