File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
src/lib/internal/elements Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ <script lang =" ts" >
2
+ import type { ActionArray } from " $lib/hooks/use-actions" ;
3
+ import { useActions } from " $lib/hooks/use-actions" ;
4
+ import { get_current_component } from " svelte/internal" ;
5
+ import { forwardEventsBuilder } from " ../forwardEventsBuilder" ;
6
+
7
+ export let use: ActionArray = [];
8
+ export let el: HTMLAnchorElement | null = null ;
9
+ const forwardEvents = forwardEventsBuilder (get_current_component ());
10
+
11
+ export let href = " javascript:void(0);" ;
12
+ </script >
13
+
14
+ <a
15
+ bind:this ={el }
16
+ use:useActions ={use }
17
+ use:forwardEvents
18
+ {href }
19
+ {...$$restProps }
20
+ >
21
+ <slot />
22
+ </a >
Original file line number Diff line number Diff line change
1
+ <script lang =" ts" >
2
+ import type { ActionArray } from " $lib/hooks/use-actions" ;
3
+ import { useActions } from " $lib/hooks/use-actions" ;
4
+ import { get_current_component } from " svelte/internal" ;
5
+ import { forwardEventsBuilder } from " ../forwardEventsBuilder" ;
6
+ export let use: ActionArray = [];
7
+ export let el: HTMLButtonElement | null = null ;
8
+ const forwardEvents = forwardEventsBuilder (get_current_component ());
9
+ </script >
10
+
11
+ <button bind:this ={el } use:useActions ={use } use:forwardEvents {...$$restProps }>
12
+ <slot />
13
+ </button >
You can’t perform that action at this time.
0 commit comments