for in 循环对象属性
let data = {//js中属性名不能用-连接单词命名 可以在外面用加引号或用驼峰命名
"clazz-approval": {name: "clazz", label: "班级审批通知"},
"courseFinish-approval": {name: "courseFinish", label: "班级结业审批通知"},
"nosubtrainorg-approval": {name: "nosubtrainorg", label: "非补贴培训机构审批"}
}
for(let i in data) {
console.log("i===",i);//依次打印属性名
i = "clazz-approval",
i = "courseFinish-approval",
i = "nosubtrainorg-approval"
console.log("data[i]===",data[i]);//依次打印属性的值
data[i] = {name: "clazz", label: "班级审批通知"},
data[i] = {name: "courseFinish", label: "班级结业审批通知"},
data[i] = {name: "nosubtrainorg", label: "非补贴培训机构审批"}
}