mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-24 11:05:17 +08:00
fix(components): [dialog/drawer] header slot
- Fix header slot rendering for both dialog and drawer. - Change the deprecation for `title` slot to **3.0.0**.
This commit is contained in:
parent
e0a2544f70
commit
c3486bcdce
@ -45,12 +45,13 @@
|
||||
>
|
||||
<template #header>
|
||||
<slot
|
||||
v-if="!$slots.title"
|
||||
name="header"
|
||||
:close="handleClose"
|
||||
:title-id="titleId"
|
||||
:title-class="ns.e('title')"
|
||||
/>
|
||||
<slot name="title" />
|
||||
<slot v-else name="title" />
|
||||
</template>
|
||||
<slot />
|
||||
<template v-if="$slots.footer" #footer>
|
||||
@ -92,7 +93,7 @@ useDeprecated(
|
||||
scope: 'el-dialog',
|
||||
from: 'the title slot',
|
||||
replacement: 'the header slot',
|
||||
version: '2.3.0',
|
||||
version: '3.0.0',
|
||||
ref: 'https://element-plus.org/en-US/component/dialog.html#slots',
|
||||
},
|
||||
computed(() => !!slots.title)
|
||||
|
@ -41,21 +41,17 @@
|
||||
/>
|
||||
<header v-if="withHeader" :class="ns.e('header')">
|
||||
<slot
|
||||
v-if="!$slots.title"
|
||||
name="header"
|
||||
:close="handleClose"
|
||||
:title-id="titleId"
|
||||
:title-class="ns.e('title')"
|
||||
>
|
||||
<span
|
||||
v-if="!$slots.title"
|
||||
:id="titleId"
|
||||
role="heading"
|
||||
:class="ns.e('title')"
|
||||
>
|
||||
<span :id="titleId" role="heading" :class="ns.e('title')">
|
||||
{{ title }}
|
||||
</span>
|
||||
</slot>
|
||||
<slot name="title">
|
||||
<slot v-else name="title">
|
||||
<!-- DEPRECATED SLOT -->
|
||||
</slot>
|
||||
<button
|
||||
@ -112,7 +108,7 @@ export default defineComponent({
|
||||
scope: 'el-drawer',
|
||||
from: 'the title slot',
|
||||
replacement: 'the header slot',
|
||||
version: '2.3.0',
|
||||
version: '3.0.0',
|
||||
ref: 'https://element-plus.org/en-US/component/drawer.html#slots',
|
||||
},
|
||||
computed(() => !!slots.title)
|
||||
|
Loading…
Reference in New Issue
Block a user