我的componet.ts中有一个手柄表,当我尝试使用下拉列表并单击向下箭头时,它只是变成了一个文本编辑器。只是想知道我是怎么让这个下降者正常工作的。

componet.ts
dateToday: number = Date.now();
private hotRegisterer = new HotTableRegisterer();
id = 'hotInstance';
hotSettings: Handsontable.GridSettings = {
maxRows: 22,
startRows: 2,
startCols: 2,
contextMenu : true,
height: 'auto',
width: 'auto',
minSpareRows: 1,
columns: [
{
type: 'dropdown',
source: ['sn', 'st']
},
{
editor: 'text'
},
{
type: 'date',
dateFormat: 'MM/DD/YYYY',
correctFormat: true,
defaultDate: this.dateToday+'',
}
],
colHeaders: ['Asset Type','Serial Number','Shipdate'],
rowHeaders: true,
colWidths: 300,
licenseKey: 'non-commercial-and-evaluation'
}html
<div class="hot">
<hot-table [hotId]="id" [settings]="hotSettings"></hot-table>
</div>发布于 2022-05-04 18:51:23
这是手柄的问题。https://github.com/handsontable/handsontable/issues/9452
周围的工作是添加
从“handsontable/helpers”导入{ createEmptySpreadsheetData };
在下面
hotSettings: Handsontable.GridSettings = {}
添加
资料来源: createEmptySpreadsheetData(4,4),
这必须是4或更大,否则下拉不起作用。然后在packages.json中,在导出项下,您必须添加
"./helpers/data.d.ts":"./helpers/data.d.ts",
“./帮手”:{
“要求”:"./helpers/data.js",
“导入”:"./helpers/data.mjs“},
https://stackoverflow.com/questions/72088575
复制相似问题