@@ -13,6 +13,7 @@ import {
1313import {
1414 SLOT_NAME_DEFAULT ,
1515 SLOT_NAME_FOOTER ,
16+ SLOT_NAME_HEADER ,
1617 SLOT_NAME_HEADER_CLOSE ,
1718 SLOT_NAME_TITLE
1819} from '../../constants/slots'
@@ -21,7 +22,6 @@ import { getRootActionEventName, getRootEventName } from '../../utils/events'
2122import { makeModelMixin } from '../../utils/model'
2223import { sortKeys } from '../../utils/object'
2324import { makeProp , makePropsConfigurable } from '../../utils/props'
24- import { toString } from '../../utils/string'
2525import { attrsMixin } from '../../mixins/attrs'
2626import { idMixin , props as idProps } from '../../mixins/id'
2727import { listenOnRootMixin } from '../../mixins/listen-on-root'
@@ -92,7 +92,7 @@ export const props = makePropsConfigurable(
9292
9393const renderHeaderTitle = ( h , ctx ) => {
9494 // Render a empty `<span>` when to title was provided
95- const title = ctx . computedTile
95+ const title = ctx . normalizeSlot ( SLOT_NAME_TITLE , ctx . slotScope ) || ctx . title
9696 if ( ! title ) {
9797 return h ( 'span' )
9898 }
@@ -123,8 +123,12 @@ const renderHeader = (h, ctx) => {
123123 return h ( )
124124 }
125125
126- const $title = renderHeaderTitle ( h , ctx )
127- const $close = renderHeaderClose ( h , ctx )
126+ let $content = ctx . normalizeSlot ( SLOT_NAME_HEADER , ctx . slotScope )
127+ if ( ! $content ) {
128+ const $title = renderHeaderTitle ( h , ctx )
129+ const $close = renderHeaderClose ( h , ctx )
130+ $content = ctx . right ? [ $close , $title ] : [ $title , $close ]
131+ }
128132
129133 return h (
130134 'header' ,
@@ -133,7 +137,7 @@ const renderHeader = (h, ctx) => {
133137 class : ctx . headerClass ,
134138 key : 'header'
135139 } ,
136- ctx . right ? [ $close , $title ] : [ $title , $close ]
140+ $content
137141 )
138142}
139143
@@ -227,11 +231,16 @@ export const BSidebar = /*#__PURE__*/ Vue.extend({
227231 const { hide, right, localShow : visible } = this
228232 return { hide, right, visible }
229233 } ,
230- computedTile ( ) {
231- return this . normalizeSlot ( SLOT_NAME_TITLE , this . slotScope ) || toString ( this . title ) || null
234+ hasTitle ( ) {
235+ const { $scopedSlots, $slots } = this
236+ return (
237+ ! this . noHeader &&
238+ ! this . hasNormalizedSlot ( SLOT_NAME_HEADER ) &&
239+ ! ! ( this . normalizeSlot ( SLOT_NAME_TITLE , this . slotScope , $scopedSlots , $slots ) || this . title )
240+ )
232241 } ,
233242 titleId ( ) {
234- return this . computedTile ? this . safeId ( '__title__' ) : null
243+ return this . hasTitle ? this . safeId ( '__title__' ) : null
235244 } ,
236245 computedAttrs ( ) {
237246 return {
0 commit comments