Skip to content

Commit

Permalink
[doc] ES6 Destructuring - 뷰에 적용하는 구조 분해 문법 문서 수정
Browse files Browse the repository at this point in the history
- this에 구조 분해 문법 적용시 주의사항 추가
  • Loading branch information
padosum committed Aug 31, 2021
1 parent 2c815bd commit a68f9a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/es6/destructuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ export default {
savePost(id);
},
},
}
</script>
```
위 코드를 살펴보면 `this`를 매번 입력하지 않아도 되는 이점과 더불어 코드에서 어떤 데이터와 기능(function 등)만을 사용하는지 명확하게 파악할 수 있습니다. 그러므로 코드 작성자의 의도를 더 잘 설명해줍니다.

위 코드를 살펴보면 `this`를 매번 입력하지 않아도 되는 이점이 있습니다. **다만, 해당 데이터가 현재 컴포넌트의 데이터인지, 외부에서 가져오는 메서드인지 구분이 어려워지기 때문에 프로젝트에 정해진 컨벤션에 맞춰 주의해서 사용할 필요가 있습니다.**

## 뷰에 적용하는 구조 분해 문법 2
[v-for 디렉티브](https://joshua1988.github.io/vue-camp/vue/template.html#%E1%84%83%E1%85%B5%E1%84%85%E1%85%A6%E1%86%A8%E1%84%90%E1%85%B5%E1%84%87%E1%85%B3)를 사용할 때도 구조 분해 문법을 활용할 수 있습니다.
Expand Down

0 comments on commit a68f9a2

Please sign in to comment.