@@ -13,6 +13,7 @@ import {
13
13
import {
14
14
SLOT_NAME_DEFAULT,
15
15
SLOT_NAME_FOOTER,
16
+
SLOT_NAME_HEADER,
16
17
SLOT_NAME_HEADER_CLOSE,
17
18
SLOT_NAME_TITLE
18
19
} from '../../constants/slots'
@@ -21,7 +22,6 @@ import { getRootActionEventName, getRootEventName } from '../../utils/events'
21
22
import { makeModelMixin } from '../../utils/model'
22
23
import { sortKeys } from '../../utils/object'
23
24
import { makeProp, makePropsConfigurable } from '../../utils/props'
24
-
import { toString } from '../../utils/string'
25
25
import { attrsMixin } from '../../mixins/attrs'
26
26
import { idMixin, props as idProps } from '../../mixins/id'
27
27
import { listenOnRootMixin } from '../../mixins/listen-on-root'
@@ -92,7 +92,7 @@ export const props = makePropsConfigurable(
92
92
93
93
const renderHeaderTitle = (h, ctx) => {
94
94
// 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
96
96
if (!title) {
97
97
return h('span')
98
98
}
@@ -123,8 +123,12 @@ const renderHeader = (h, ctx) => {
123
123
return h()
124
124
}
125
125
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
+
}
128
132
129
133
return h(
130
134
'header',
@@ -133,7 +137,7 @@ const renderHeader = (h, ctx) => {
133
137
class: ctx.headerClass,
134
138
key: 'header'
135
139
},
136
-
ctx.right ? [$close, $title] : [$title, $close]
140
+
$content
137
141
)
138
142
}
139
143
@@ -227,11 +231,16 @@ export const BSidebar = /*#__PURE__*/ Vue.extend({
227
231
const { hide, right, localShow: visible } = this
228
232
return { hide, right, visible }
229
233
},
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
+
)
232
241
},
233
242
titleId() {
234
-
return this.computedTile ? this.safeId('__title__') : null
243
+
return this.hasTitle ? this.safeId('__title__') : null
235
244
},
236
245
computedAttrs() {
237
246
return {
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4