From b9c43952429ae9b1514afb179a276f036d645a19 Mon Sep 17 00:00:00 2001 From: zhixin Date: Thu, 14 Nov 2024 08:39:12 +0800 Subject: [PATCH] Added card-view-field class to card-view --- src/bootstrap-table.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index 545e1eafb..00e39e2e2 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -1569,6 +1569,7 @@ class BootstrapTable { class: this.header.classes[j] ? [this.header.classes[j]] : [], style: this.header.styles[j] ? [this.header.styles[j]] : [] } + const cardViewClass = `card-view card-view-field-${field}` if ((this.fromHtml || this.autoMergeCells) && typeof value_ === 'undefined') { if (!column.checkbox && !column.radio) { @@ -1660,7 +1661,7 @@ class BootstrapTable { item[this.header.stateField] = value === true || (!!value_ || value && value.checked) return Utils.h(this.options.cardView ? 'div' : 'td', { - class: [this.options.cardView ? 'card-view' : 'bs-checkbox', column.class], + class: [this.options.cardView ? cardViewClass : 'bs-checkbox', column.class], style: this.options.cardView ? undefined : attrs.style }, [ Utils.h('label', {}, [ @@ -1680,7 +1681,7 @@ class BootstrapTable { if (this.options.cardView) { if (this.options.smartDisplay && value === '') { - return Utils.h('div', { class: 'card-view' }) + return Utils.h('div', { class: cardViewClass }) } const cardTitle = this.options.showHeader ? @@ -1690,7 +1691,7 @@ class BootstrapTable { html: Utils.getFieldTitle(this.columns, field) }) : '' - return Utils.h('div', { class: 'card-view' }, [ + return Utils.h('div', { class: cardViewClass }, [ cardTitle, Utils.h('span', { class: ['card-view-value', cellStyle.classes],