adds on:select handler to tabs component
This commit is contained in:
parent
f25bebf822
commit
61e1529ea8
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import "@spectrum-css/tabs/dist/index-vars.css"
|
import "@spectrum-css/tabs/dist/index-vars.css"
|
||||||
import { writable } from 'svelte/store'
|
import { writable } from 'svelte/store'
|
||||||
import { onMount, setContext } from 'svelte'
|
import { onMount, setContext, createEventDispatcher } from 'svelte'
|
||||||
|
|
||||||
export let selected;
|
export let selected;
|
||||||
export let vertical = false
|
export let vertical = false
|
||||||
|
@ -11,7 +11,10 @@
|
||||||
|
|
||||||
let container;
|
let container;
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
$: selected = $tab.title
|
$: selected = $tab.title
|
||||||
|
$: selected = dispatch('select', selected)
|
||||||
|
|
||||||
let top, left, width, height;
|
let top, left, width, height;
|
||||||
$: calculateIndicatorLength($tab)
|
$: calculateIndicatorLength($tab)
|
||||||
|
|
Loading…
Reference in New Issue