vue.js 20
<html>
<head>
<title>test20</title>
</head>
<body>
<div id="app">
<global-component></global-component>
<local-component></local-component>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
var globalComponent = {
template:'<div>안녕하세요!!</div>'
};
var localComponent = {
template:'<div>날씨가 좋아요</div>'
}
//전역 컴포넌트
//Vue.component('globalComponent', globalComponent);
Vue.component('global-component', globalComponent);
new Vue({
el:'#app',
//지역 컴포넌트
components:{
'local-component': localComponent
}
});
</script>
</body>
</html>
댓글
댓글 쓰기