
| 参数 | 功能描述 |
| style | 样式 |
| props | 绑定数值以及一些api设置 |
| on | 绑定相关方法,例如点击事件 |
{
title: "企业名称",
key: "enterpriseId",
align: "center",
render: (h, params) => {
return h("div", [
h(
"Select",
{
style: {
},
props: {
value: this.groupData[params.index].enterpriseId,
placement: "top",
filterable: true,
clearable: true,
allowCreate: true
},
on: {
"on-change": event => {
this.groupData[params.index].enterpriseId = event;
params.row.enterpriseId = event;
this.ShowCompanyInfo(params.row, params.index);
},
"on-create": event => {
this.addEnterprise(event);
}
}
},
this.enterpriseList.map((item, itemIndex) => {
return h(
"Option",
{
props: {
value: item.id,
key: item.id
}
},
item.name
);
})
)
]);
}
}
注意
循环option的时候不要用forEach,forEach在render函数中不起作用,此处应用map。
