티스토리 뷰
setup(props, context) {
function remove(item,index) {
localStorage.removeItem(item);
context.emit('remove',index);
}
props.todoItems
props.userId
return {remove}
}
위처럼 코드를 생각하면
setup({todoItems, userId}, context) {
function remove(item,index) {
localStorage.removeItem(item);
context.emit('remove',index);
}
props.todoItems
props.userId
return {remove}
}
아래처럼 props를 디스트럭쳐링을 하면 안된다. 디스트럭쳐링을 하는 순간, vue의 반응성(reactivity)가 사라지게 된다. 그래서 props는 있는 그대로 사용해야한다.
만약 디스트럭쳐링을 하면, props의 값이 바뀌어도 해당 함수의 값은 변하지 않게 된다!
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- jpa api
- 향해99
- 백엔드 개발자 역량
- reject
- React
- 리터럴
- 스프링부트
- hypertexttransferprotocol
- SpringBoot
- 예외처리
- ArgumentResolver
- 항해플러스
- 백엔드 개발자 공부
- 향해플러스백엔드
- 항해99
- rejectValue
- 스프링공부
- 컨트
- thymleaf
- HTTP
- 로그인
- 인터셉터
- 향해플러스
- BindingResult
- Intercepter
- JPA
- react실행
- exception
- Java
- filter
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
글 보관함