mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-21 12:49:20 +00:00
feat(tooltip-definition): dispatch open, close events
This commit is contained in:
parent
c4743708e7
commit
e19e413885
1 changed files with 6 additions and 0 deletions
|
@ -25,9 +25,15 @@
|
||||||
/** Obtain a reference to the button HTML element */
|
/** Obtain a reference to the button HTML element */
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
|
import { createEventDispatcher } from "svelte";
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
const hide = () => (open = false);
|
const hide = () => (open = false);
|
||||||
|
|
||||||
const show = () => (open = true);
|
const show = () => (open = true);
|
||||||
|
|
||||||
|
$: dispatch(open ? "open" : "close");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window
|
<svelte:window
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue