div v-for=children in list div v-for=children in children div class=table v-for=children in children childrentitle !-- title -- div div div将这段代码的titl
你可以使用一个新的数组来存储这些title值。以下是一个示例代码,演示了如何将title值放入新的一维数组中:
let newArray = [];
// 假设list是你的数据数组
list.forEach(children => {
children.forEach(child => {
child.forEach(grandchild => {
newArray.push(grandchild.title);
});
});
});
console.log(newArray);
这样,每次循环遍历到一个title值时,就会将其添加到新的一维数组newArray中。最后,你可以通过console.log(newArray)来打印新数组的内容。
原文地址: http://www.cveoy.top/t/topic/iU3J 著作权归作者所有。请勿转载和采集!