function changeTree(val) {let arr = [];if (val.length !== 0) {val.forEach(item => {let obj = {};obj.id = item.path;obj.label = item.name;if (item.children.length >= 1) {obj.children = this.changeTree(item.children);}arr.push(obj);});}
return arr;
},
}
题目:{
{item.question}}
{
{item2}}
答案:{
{item.answer}}
赋值代码:getData() {
console.log("试卷编号是:id==" + localStorage.getItem("examId"));this.$axios.get("/exam/findExamById", {params: {id: localStorage.getItem("examId")}}).then(response => {
console.log(response.data.result);if (response.data.result) {
// this.ruleForm = response.data.result;console.log(typeof this.ruleForm);var
}
1.思路:三组数据为一组那么我们可以把三组数据放到一个集合里面。遍历的时候双层for循环
{{data.name}}
效果图如下:码字不易,如果对您有帮助请点个小心心!}