
[DAY 34] Vue (2)
·
Frontend/프로그래머스 FE 데브코스
1. Computed : 계산된 데이터 - Vue 내부에서 캐싱 기능을 제공하기 때문에 반복된 계산은 한번만 일어난다. - 계산된 데이터는 의존성을 가지고 있다. 1) 사용 방법 {{count}} {{double}} {{double}} // 한번만 계산된다. 2) getter, setter 사용하기 data() { return { firstName: "Leon", lastName: "Miller", }; }, computed: { fullName: { get() { return `${this.firstName} ${this.lastName}`; }, set(newValue) { const names = newValue.split(" "); this.firstName = names[0]; this.last..