compute vs method

구태훈·2020년 6월 23일
0

vue

목록 보기
2/2

compute : 결과 값이 watch된다. 즉 다른 properties의 update가 일어나면 값이 제 계산되며, 이것이 dom에 bind되어 있는 경우 update가 일어 난다.

  • compute의 값은 cache된다.

method : 명시적으로 호출하여 값을 사용한다.

  • compute는 parameter를 받을 수 없지만, method는 받을 수 있다.
profile
사업가를 꿈꾸는 소프트웨어 개발자.

0개의 댓글