호출 부분
const removeColList = await this.fn_originChk(indicesToRemove);
const indiColList = await this.selIndiColsList(removeColList);
메서드 부분
//품질 지표 컬럼을 참조하고 있는 컬럼 조회
async selIndiColsList(data){
const params = {
tableNm: this.tableNm,
colList: data
};
let api = '/ajax/getData.do';
await axios.post(process.env.VUE_APP_API_URL + api, params)
.then(response => {
console.log("response.data : ",response.data.indiColList);
return response.data.indiColList;
})
.catch(error => {
console.log('error >> ' + error)
})
},
백날해도 indiColList 가 undefined가 뜬다.
//품질 지표 컬럼을 참조하고 있는 컬럼 조회
async selIndiColsList(data) {
const params = {
tableNm: this.tableNm,
colList: data
};
let api = '/ajax/getData.do';
try {
const response = await axios.post(process.env.VUE_APP_API_URL + api, params);
console.log("response.data : ", response.data.indiColList);
return response.data.indiColList; // 응답 데이터의 indiColList 반환
} catch (error) {
console.log('error >> ', error);
return []; // 에러 발생 시 빈 배열 반환
}
}
이런식으로 response 객체가 const 로 뺀 후 return 하니까 잘 넘어감
제가 빠뜨린 부분이나 이유를 알고 계신다면 댓글 부탁드립니다..
'Front-End > Vue.js' 카테고리의 다른 글
| Chat GPT에게 물어본 watch의 deep옵션 (0) | 2024.02.22 |
|---|---|
| Vue Warn 사례 (0) | 2024.02.22 |
| [Vue.js] 체크박스 선택 행 삭제, 행 추가 기능 만들기 (0) | 2024.02.22 |