물품 상세페이지 / 이미지 불러오기 - GET
async handleData(){
const url = `/item/selectone?code=${this.code}`;
// code인지 no인지 잘 확인할것
const headers = {"Content-Type":"application/json"};
const response = await this.axios.get(url, {headers:headers});
console.log(response.data);
if(response.data.status === 200){
this.item = response.data.result;
// response.data.result를 this.item에 다 넣음
console.log(response.data.result);
}
}
const url = `/item/selectone?code=${this.code}`;
: 이미지 꺼내올 백엔드 주소
: code
인지 no
인지 cno
인지 변수확인 잘 할것
const headers = {"Content-Type":"application/json"};
const response = await this.axios.get(url, {headers:headers});
: headers
, response
똑같음
: GET
을 쓴다.
this.item = response.data.result;
: if
문 조건을 확인하고,
: response.data.result
를 this.item
에 다 넣음
<img :src="item.image" style="width:50%;" />
item.image
에서 불러왔다는 뜻handleData()
에서 response.data.result
를 this.item
에 다 넣음