티스토리 뷰
공통점
Reactive Data 변경 시점에 처리를 담당
차이점
Program State 변경 Logic 존재 여부
- 존재 : Watch 사용
- 미 존재 : Computed 사용
Computed는 Program state를 바꾸지 않는 Pure Function이다.
예시
computed
data() {
return {
name: "half"
}
}
computed:{
welcome() {
return "hi" + this.name
}
}
watch
data() {
return {
isLoading: false,
data1: 1,
data2: 2,
}
}
methods: {
// someProcess1, someProcess2 : change Program State
someProcess1() {
...
this.data1 = 10
...
}
someProcess2() {
...
this.data2 = 20
...
}
}
watch: {
isLoading(newVal) {
if(newVal == true) someProcess1()
else someProcess2()
}
}
'Vue.js' 카테고리의 다른 글
[nuxt3] 초기 프로젝트 설정 (with. eslint, prettier, quasar 모듈) (0) | 2025.07.13 |
---|---|
[vue] TypeError: Cannot read properties of null (reading 'isCE') 해결 (vue & vite 사용자) (0) | 2024.03.12 |
[Vue] Comoponent 내 상수 관리 (0) | 2022.12.03 |
[Vue3] Child Component에 v-model 사용하기 (0) | 2022.08.30 |
[Vue] ESLint, Prettier 적용 및 VSCode 적용 (0) | 2022.08.24 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- vue watch 문제점
- docker mssql 이미지 생성
- nuxt3 structure
- 티스토리챌린지
- vue 리팩토링
- unplugin-auto-import
- oracle 19c 설치
- unmounted composable
- nuxt3 eslint prettier 설정
- docker image 경량화
- docker mssql
- nuxt3 quasar 설정
- vue onunmounted
- 외래키 삭제
- 오블완
- 스마트피싱보호_캠페인
- unmounted setinterval
- Oracle Database 19c install
- vue 타이머 해제
- vue watch 위험성
- vue unmounted
- nuxt3 프로젝트 설정
- Oracle Database 19C 설치
- 스파르타 코딩클럽
- vue watch 대체
- dockerignore
- unmounted document.addlistener
- docker multi stage build
- vue 이벤트 해제
- docker mssql create database
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함