首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular13手持式下拉列表不工作

Angular13手持式下拉列表不工作
EN

Stack Overflow用户
提问于 2022-05-02 15:00:08
回答 1查看 106关注 0票数 0

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

componet.ts

代码语言:javascript
复制
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

代码语言:javascript
复制
<div class="hot">
   <hot-table [hotId]="id" [settings]="hotSettings"></hot-table>
</div>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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“},

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72088575

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档