티스토리 뷰
공통점
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 create database
- Oracle Database 19C 설치
- FastAPI 초기 구성
- unmounted document.addlistener
- unplugin-auto-import
- docker mssql 이미지 생성
- Pydantic 기초
- vue 리팩토링
- 티스토리챌린지
- nuxt3 quasar 설정
- Composable vs Class
- nuxt3 프로젝트 설정
- python Pydantic
- 스파르타 코딩클럽
- vue watch 문제점
- 의존성 패키지 관리
- Compoent
- Composable vs Component
- nuxt3 structure
- nuxt3 eslint prettier 설정
- Oracle Database 19c install
- 스마트피싱보호_캠페인
- Pydantic 기능
- 오블완
- python venv 구성
- oracle 19c 설치
- docker mssql
- vue watch 대체
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함
