Skip to content

Commit 4970577

Browse files
committed
feat: Add possibility to use Slot in ListmonkButton component
1 parent b5b586d commit 4970577

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

playground/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</template>
2828
</ListmonkInputGroup>
2929

30-
<ListmonkButton title="Send" />
30+
<ListmonkButton>Send</ListmonkButton>
3131
</ListmonkForm>
3232
</div>
3333
</template>
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
<script setup lang="ts">
22
defineProps<{
33
type?: string
4-
title: string
4+
title?: string
55
}>()
6+
7+
const slots = useSlots()
68
</script>
79

810
<template>
911
<button
1012
:type="type || 'submit'"
1113
>
12-
{{ title }}
14+
<template v-if="slots.default">
15+
<slot />
16+
</template>
17+
18+
<template v-else>
19+
{{ title }}
20+
</template>
1321
</button>
1422
</template>

0 commit comments

Comments
 (0)