글로벌컴포넌트를 재활용하는 방법.
주의할 점: props 변수 명을 카멜 기법(aBow)으로 정의하면 html 태그에서 사용할 때는 케밥 기법(-)으로 선언해야 한다.
initial'C'ount를 initial'-c'ounter로 표기한다.
<global-component v-bind:initial-counter="counter"> </global-component><br>
// 글로벌컴포넌트를 등록하는 작업
Vue.component(GlobalComponent.name, GlobalComponent)
export default {
components: {
// 로컬컴포넌트를 등록하는 작업. 글로벌은 전역으로 쓸 수 있고 로컬은 여기서만 쓸 수 있다.
'local-component': LocalComponent },
'Frontend > 뷰 Vue.js' 카테고리의 다른 글
Vuetify 설치 (0) | 2020.08.18 |
---|---|
dispatch / commit (0) | 2020.08.18 |
v-model (0) | 2020.08.18 |
Vue란? (0) | 2020.08.18 |
<input type=" "에서 readonly, disabled> (0) | 2020.08.18 |