์๋ฌ๋ฉ์ธ์ง ๋ด์ฉ
Module Error (from ./node_modules/eslint-loader/index.js):
error: Use object destructuring (prefer-destructuring) at src\views\mr\BrandPerformance.vue:296:13:
294 | const compComboId = '#PRODUCT_BY_RANGE#';
295 | const yyyymm = this.query.yyyymm.replace(/-/gi, '');
> 296 | const prodRangeCd = this.query.prodRangeCd;
| ^
297 | const rs = await this.compCodeList(compComboId, yyyymm, prodRangeCd);
298 | const clsRow = rs.data.resultList;
์ ์๋ฌ๋ this.query.prodRangeCd๋ฅผ ๊ตฌ์กฐ ๋ถํด๋ฅผ ํตํด ๊ฐ์ ธ์ค์ง ์์๊ธฐ ๋๋ฌธ์ ๋ฐ์ํ๋ค.
๊ฐ์ฒด ๊ตฌ์กฐ ๋ถํด๋ฅผ ํตํด this.query์ ์์ฑ์ ์ข ๋ ๊ฐ๊ฒฐํ๊ฒ ์ถ์ถํ๋ผ๋ ๋ด์ฉ์ด๋ค.
this.query ๊ฐ์ฒด์์ ์ฌ๋ฌ ์์ฑ์ ๊ฐ์ ธ์จ๋ค๋ฉด ๊ตฌ์กฐ ๋ถํด๋ฅผ ํตํด ์ฝ๋์ ๊ฐ๋ ์ฑ์ ๋์ผ ์ ์๋ค.
์์ ๋ฐ์
const { yyyymm, prodRangeCd } = this.query;
const compComboId = '#PRODUCT_BY_RANGE#';
const formattedYyyymm = yyyymm.replace(/-/gi, '');
const rs = await this.compCodeList(compComboId, formattedYyyymm, prodRangeCd);
const clsRow = rs.data.resultList;
์ด๋ ๊ฒ ์์ ํ๋ฉด this.query ๊ฐ์ฒด์์ yyyymm๊ณผ prodRangeCd๋ฅผ ํ ๋ฒ์ ๊ตฌ์กฐ ๋ถํดํ์ฌ ์ถ์ถํ ์ ์๋ค.
'Errors' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[SVN] svn commit has encountered a problem (0) | 2022.05.23 |
---|