AAA.vue eslint 에러 발생
> 'XX' is defined but never used
* 해결
아래 주석을 해당 라인에 추가
// eslint-disable-line no-unused-vars
onBeforeRouteLeave : 사용자가 현재 view 를 떠날 시 수행
ex)
import { onBeforeRouteLeave } from 'vue-router';
onBeforeRouteLeave(() => {
const answer = window.confirm('떠남?');
if (answer === false) {
return false;
}
});
==, ===
변수 타입에 상관없이 값이 같은 경우 >> '=='
변수 타입과 값, 모두 같은 변수 비교시 >> '==='
router.push({
name: 'About',
state: {
one: 1,
two: 2
}
});
>>
const { one } = history.state;
const { two } = history.state;
console.log('one = ' + one);
console.log('two = ' + two);
'2024' 카테고리의 다른 글
20240801_react (0) | 2024.08.01 |
---|---|
20240716_nuxt3 (0) | 2024.07.16 |
20240712_etc (0) | 2024.07.12 |
20240711_vue_router_method (0) | 2024.07.11 |
20240710_package_ES (0) | 2024.07.10 |