물품 상세페이지 / 이미지 불러오기 - 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에 다 넣음