res.forEach((element, index) => {
this.commandList.push({
name: index,
type: 'checkbox',
value: element.commandName,
checked: false,
label: element.commandName,
});
});
如有转载,著名出处洋葱先生(http://www.dreamload.cn/blog/?p=931)