안녕하세요 json 데이터를 받아와서 기존데이터에 밀어 넣으면 다음배열 한칸에 또 다른 배열이 들어가버리는 식으로 저장되어 버립니다.
어떻게 해야할까요?
export default {
name : 'produtList',
data(){
return {
ListData : [],
ReqPage: 1,
}
} ,
데이터 형태 :ListData
[
{
"rownum": 17,
"ProductNo": 1706,
"ProductCode": "DI32120038_12",
"ProductName": "1500150 레귤러트윌치노",
"ProductPrice": 138000,
"ProductPriceSale": 138000,
"ProductImageUrl": "https://gant.test.com/data/ProductImages/a/2/DI32120038_12.jpg",
"ModelImageUrl": "https://gant.test.com/data/ProductImages/model01/2/DI32120038_12.jpg"
}
]
axious
.then(result =>{
this.ListData.push(result.data);
>> 여기를 this.ListData = result.data; 이렇게 바꾸면 기존 화면이 정상적으로 바뀌긴 합니다.(아래로 붙는게 아니고)
console.log(this.ListData);
})
.catch(err=>{
console.log(err);
})
