🌐 AI搜索 & 代理 主页
Skip to content

Commit 37a6af7

Browse files
authored
make sure footer falls back to HEAD slots if FOOT slots not provided
1 parent 8c13351 commit 37a6af7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/table/helpers/mixin-thead.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,14 @@ export default {
9999
},
100100
on: handlers
101101
}
102-
const fieldScope = { label: field.label, column: field.key, field, isFoot }
103-
const slotKey = isFoot ? 'FOOT' : 'HEAD'
104-
const slot = this.normalizeSlot([`${slotKey}[${field.key}]`, `${slotKey}[]`], fieldScope)
102+
let slotNames = [`HEAD[${field.key}]`, 'HEAD[]']
103+
if (isFoot) {
104+
// Footer will fallback to header slot names
105+
slotNames = [`FOOT[${field.key}]`, 'FOOT[]', ...slotNames]
106+
}
107+
const slot = this.normalizeSlot(slotNames, {
108+
label: field.label, column: field.key, field, isFoot
109+
})
105110
if (!slot) {
106111
// need to check if this will work
107112
data.domProps = htmlOrText(field.labelHtml)

0 commit comments

Comments
 (0)