Skip to content

Commit 8ee6049

Browse files
authored
refactor: clipboard component allow alpine property (#627)
1 parent 3edd2fa commit 8ee6049

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

resources/views/clipboard.blade.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@props ([
2-
'value',
2+
'value' => null,
3+
'alpineProperty' => null,
34
'class' => 'h-10 w-12',
45
'copyInput' => false,
56
'noStyling' => false,
@@ -22,10 +23,14 @@
2223
$class,
2324
])
2425
tooltip-content="{{ $tooltipContent }}"
25-
@if($copyInput)
26-
x-on:click="copyFromInput('{{ $value }}')"
26+
@if($alpineProperty)
27+
x-on:click="copy({{ $alpineProperty }})"
2728
@else
28-
x-on:click="copy('{{ $value }}')"
29+
@if($copyInput)
30+
x-on:click="copyFromInput('{{ $value }}')"
31+
@else
32+
x-on:click="copy('{{ $value }}')"
33+
@endif
2934
@endif
3035
>
3136
@unless ($withCheckmarks)

0 commit comments

Comments
 (0)