data =[{
id:1,
name :'John Brown',
age :32,
expand : true,
address :'New York No. 1 Lake Park',
description: 'My name is John Brown, I am 32 years old, living in New York No.1 Lake Park.',
list:[{
name :'John Brown',
age :1,
address :'New York No. 1 Lake Park',
description: 'My name is John Brown, I am 32 years old, living in New York No.1 Lake Park.',}]},{
id:2,
name :'Jim Green',
age :42,
expand : false,
address :'London No. 1 Lake Park',
description: 'My name is Jim Green, I am 42 years old, living in London No.1 Lake Park.',
list:[]},{
id:3,
name :'Joe Black',
age :32,
expand : false,
address :'Sidney No. 1 Lake Park',
description: 'My name is Joe Black, I am 32 years old, living in Sidney No.1 Lake Park.',
list:[]},];test(val){if(!val.expand){
this.data = this.data.map(item =>{return{...item,
expand: item.id === val.id ? true : false
}})}else{
val.expand =!val.expand
}}