Skip to content

Commit

Permalink
fix: dialog header-end slot
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Jul 17, 2023
1 parent f54fce4 commit 763bf6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ import { RCard } from 'roughness'
<RSpace overflow>
<RTable
:columns="['name', 'parameters', 'description']"
:rows="['title', 'header-extra', 'default', 'footer']"
:rows="['title', 'header-end', 'default', 'footer']"
>
<template #body:*:name="{ row }">{{ row }}</template>
Expand All @@ -134,7 +134,7 @@ import { RCard } from 'roughness'

</template>

<template #body:header-extra:description>
<template #body:header-end:description>

The content of the card header after title.

Expand Down
21 changes: 13 additions & 8 deletions src/dialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import RCard from '../card/index.vue'
import type { GraphicsProps } from '../graphics/utils'
import RIcon from '../icon/index.vue'
import RLink from '../link/index.vue'
import RSpace from '../space/index.vue'
defineOptions({
name: 'RDialog',
Expand Down Expand Up @@ -92,14 +93,18 @@ const nestingGraphicsOptions = $computed(() => {
method="dialog"
class="r-dialog__card"
>
<template v-if="closable" #header-end>
<RLink
tag="button"
size="large"
class="r-dialog__close"
>
<RIcon name="x" size="large" />
</RLink>
<template #header-end>
<RSpace>
<slot name="header-end"></slot>
<RLink
v-if="closable"
tag="button"
size="large"
class="r-dialog__close"
>
<RIcon name="x" size="large" />
</RLink>
</RSpace>
</template>
<template #title>
<slot name="title"></slot>
Expand Down

0 comments on commit 763bf6c

Please sign in to comment.