gradio/js/tabs/static/StaticTabs.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
648 B
Svelte
Raw Normal View History

2022-03-12 00:00:48 +08:00
<script lang="ts">
import type { Gradio, SelectData } from "@gradio/utils";
import { createEventDispatcher } from "svelte";
import Tabs from "./Tabs.svelte";
const dispatch = createEventDispatcher();
export let visible = true;
export let elem_id = "";
export let elem_classes: string[] = [];
export let selected: number | string;
export let gradio: Gradio<{
change: never;
select: SelectData;
}>;
$: dispatch("prop_change", { selected });
2022-03-12 00:00:48 +08:00
</script>
<Tabs
{visible}
{elem_id}
{elem_classes}
bind:selected
on:change={() => gradio.dispatch("change")}
on:select={(e) => gradio.dispatch("select", e.detail)}
>
2022-03-12 00:00:48 +08:00
<slot />
</Tabs>