首页 > 解决方案 > 在 ag-grid 中使用时,Vaadin-combo-box 将数组转换为 [object Object]

问题描述

我在 ag-grid 中使用 Vaadin-combo-box,但不知道为什么数组转换为 [object Object]。

下面是 ag-grid 的代码

columnDefs = [{
   headerName: "Students",
   field: "studentId",
   cellRenderer: this.renderStudentDropdown
}]


renderStudentDropdown(){
const records = [{"id": "123", "title" : "Student 1"},{"id": "456", "title" : "Student 2"}]
let html = `<vaadin-combox-box .items=${templates} .value='${value}' item-label-path="title" item-value-path="id"></vaadin-combox-box>`;
return html
}

在浏览器中渲染后,它不会在下拉列表中显示数据并打印数据,如 [object Object]

在此处输入图像描述

标签: javascriptecmascript-6vaadinag-gridvaadin-core-elements

解决方案


推荐阅读