반응형

vuejs 4

태태개발일지 - Vue Computed API

Computed 기본적으로 Computed를 사용하는 경우는 변수 즉 값이 계속 변하는 수를 변환시킬 때 Computed를 사용하여 이를 처리한다.  컴퓨티드(computed) API는 컴포지션(Composition API)에서 사용된 컴퓨티드 속성을 의미한다.   {{ reversedMessage }} 기본 Computed는 다음과 같이 사용할 수 있다.  {{ reversedMessage }} Set up() 을 사용하여 Computed API를 사용한다면 아래와 같이 사용하면 된다.

Front/Vue 2024.11.20

태태개발일지 - Vue js mapMutations

mapMutationsvuex는 state , getter, mutation, actions 로 나뉜다. 앞서 state를 쉽게 mapState를 통해 가져오는 것을 보았으니, 이번에는 Mutation를 가져오는 방법을 봐보겠다.  import { mapMutations, mapState } from 'vuex'; methods:{ ...mapMutations(['addOneItem']), // Vuex mutation 매핑 addTodo() { if (this.newTodoItem !== '') { this.addOneItem(this.newTodoItem); // Vuex mutation 호출 this.clearInput(); // 입력 필드 초기화 ..

Front/Vue 2024.11.17

태태개발일지 - VUE ES6

const & let - 새로운 변수 선언 방식블록 단위로 변수의 범위사 제한 되어있음, { } const -> finallet -> 선언한 값에 대해서 다시 선언할 수 없음 const a =10;a =20; //오류var c = 10;c = 20; //동작let a = 10;let a = 20; //오류a= 30; // 가능하다. ES5의 특징 - 변수의 Scopevar sum = 0;for(var i =1; i for문 안에서 선언했어도 밖에서도 값을 구경할 수 있다. Hoisting -> 끌어올려진다.function willBeOveridden(){ return 10;}willBeOveridden(); //5//함수 선언문function willBeOveridden(){ return 5;}//함수 ..

Front/Vue 2024.11.11
반응형