【发布时间】:2021-05-06 16:52:12
【问题描述】:
我正在尝试在新行中显示我的标题名称,但我无法做到。
ag-grid-vue 版本:6.12.0
这是我尝试过的,但没有成功:
defaultColDef: {
sortable: true,
editable: true,
resizable: true,
suppressMenu: true
},
columnDefs: [
{
headerName: 'Average low ', // This value is displayed in a single line
field: 'average_low',
width: 200,
},
{
headerName: 'Average high ', // Even this value is displayed in a single line
field: 'average_high',
width: 200,
},
...
}
我尝试了这样的方法来在新行中显示 headerName:
{
headerName: 'Avg. \n low ', // This value is displayed in a single line
field: 'average_low',
width: 200,
},
{
headerName: 'Avg. </br> high ', // Even this value is displayed in a single line
field: 'average_high',
width: 200,
},
我想显示如下内容:
请告诉我如何做到这一点。这是官方文档:
https://www.ag-grid.com/documentation/vue/component-header/
这是显示示例并可用于锻炼的 plunker:
【问题讨论】: