Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Use default slot for popover content
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed Nov 11, 2021
1 parent 04f4e3c commit 596a214
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/VPopover/VPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
:aria-labelledby="labelledBy"
>
<!-- @slot The content of the popover -->
<slot name="content" />
<slot name="default" />
</VPopoverContent>
</div>
</template>
Expand Down
12 changes: 3 additions & 9 deletions src/components/VPopover/meta/VPopover.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const SinglePopoverStory = (args, { argTypes }) => ({
<template #trigger="{ visible, a11yProps }">
<VButton :pressed="visible" v-bind="a11yProps">{{ visible ? 'Close' : 'Open' }}</VButton>
</template>
<template #content>
<div>Code is Poetry</div>
</template>
<div>Code is Poetry</div>
</VPopover>
</div>
`,
Expand All @@ -57,18 +55,14 @@ const TwoPopoverStory = (args, { argTypes }) => ({
<template #trigger="{ visible, a11yProps }">
<VButton :pressed="visible" v-bind="a11yProps">{{ visible ? 'First popover open' : 'First popover closed' }}</VButton>
</template>
<template #content>
<div>First popover content</div>
</template>
<div>First popover content</div>
</VPopover>
<div class="h-5">Some content</div>
<VPopover label="Second popover" v-bind="$props">
<template #trigger="{ visible, a11yProps }">
<VButton :pressed="visible" v-bind="a11yProps">{{ visible ? 'Second popover open' : 'Second popover closed' }}</VButton>
</template>
<template #content>
<div>Second popover content</div>
</template>
<div>Second popover content</div>
</VPopover>
</div>
`,
Expand Down
4 changes: 1 addition & 3 deletions test/unit/specs/components/v-popover.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const TestWrapper = Vue.component('TestWrapper', {
<template #trigger="{ visible, a11yProps }">
<VButton :pressed="visible" v-bind="a11yProps">{{ visible ? 'Close' : 'Open' }}</VButton>
</template>
<template #content>
<div :tabindex="popoverContentTabIndex">Code is Poetry</div>
</template>
<div :tabindex="popoverContentTabIndex">Code is Poetry</div>
</VPopover>
</div>
`,
Expand Down

0 comments on commit 596a214

Please sign in to comment.