Skip to content

Commit

Permalink
feat(#93): add tag prop to customise component tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Mar 12, 2024
1 parent 8f05f78 commit 4c3ff6e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/components/Popover.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div
<component
:is="tag"
:class="`ct-popover ${themeClass}`"
data-collapsible="1"
data-collapsible-collapsed=""
Expand All @@ -18,16 +19,17 @@
</slot>
</a>

<div
<component
:is="tag"
class="ct-popover__content"
data-collapsible-panel
data-collapsible-trigger-no-icon
>
<div class="ct-popover__content__inner">
<component :is="tag" class="ct-popover__content__inner">
<slot />
</div>
</div>
</div>
</component>
</component>
</component>
</template>

<script>
Expand All @@ -37,6 +39,10 @@ export default {
mixins: [ThemeMixin],
props: {
tag: {
type: String,
default: 'div'
},
trigger: {
type: String,
default: 'Click me'
Expand Down

0 comments on commit 4c3ff6e

Please sign in to comment.