본문 바로가기

Vue.js

컴포넌트와 태그 매핑

728x90

상황 가정 : App 컴포넌트에서 ChildComponent(파스칼) 또는 childComponent(카멜) 컴포넌트 등록 

매핑: ChildComponent는 사용자 정의 컴포넌트  <child-component> </child-component>  

// App.vue
<template>
  <div id="app">
    <child-component></child-component>
    <another-component></another-component>
  </div>
</template>

<script>
import ChildComponent from './ChildComponent.vue';
import AnotherComponent from './AnotherComponent.vue';

export default {
  name: 'App',
  components: {
    ChildComponent,
    AnotherComponent,
  },
};
</script>
728x90