File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ const props = defineProps <{
3+ source: string
4+ }>()
5+
6+ const copied = ref (false )
7+
8+ function copy() {
9+ navigator .clipboard .writeText (props .source )
10+ copied .value = true
11+
12+ setTimeout (() => {
13+ copied .value = false
14+ }, 2000 )
15+ }
16+ </script >
17+
18+ <template >
19+ <UInput
20+ :model-value =" props.source"
21+ aria-label =" Copy code to get started"
22+ size =" xl"
23+ class =" w-88"
24+ disabled
25+ :ui =" { base: 'disabled:cursor-default' }"
26+ >
27+ <template #leading >
28+ <UIcon name =" i-ph-terminal" />
29+ </template >
30+ <template
31+ v-if =" props .source ?.length "
32+ #trailing
33+ >
34+ <UTooltip
35+ text =" Copy to clipboard"
36+ :content =" { side: 'right' }"
37+ >
38+ <UButton
39+ :color =" copied ? 'success' : 'neutral'"
40+ variant =" link"
41+ :icon =" copied ? 'i-lucide-copy-check' : 'i-lucide-copy'"
42+ aria-label =" Copy to clipboard"
43+ @click =" copy"
44+ />
45+ </UTooltip >
46+ </template >
47+ </UInput >
48+ </template >
Original file line number Diff line number Diff line change @@ -34,16 +34,7 @@ Build Shopify Apps with Nuxt
3434 Get started
3535 :::
3636
37- ::: u-button
38- ---
39- color: neutral
40- icon: i-lucide-github
41- size: xl
42- target: _ blank
43- to: https://github.com/kiriminaja/shopify-app-nuxt
44- variant: subtle
45- ---
46- Give a star
37+ ::: copy-code-input { source =" npx nuxt module add color-mode " }
4738 :::
4839::
4940
You can’t perform that action at this time.
0 commit comments