vue.js 22
<html>
<head>
<title>test21</title>
</head>
<body>
<div id="app">
<child-component1></child-component1>
<child-component2></child-component2>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
var child1 = {
template : '<div>만나서 반가워요{{message1}}</div>',
data:function(){
return{
message1:'안녕1'
}
}
}
var child2 = {
template : '<div>고맙습니다 {{message2}}</div>',
data: function(){
return{
message2:'안녕2'
}
}
}
new Vue({
el:'#app',
components:{
'child-component1':child1,
'child-component2':child2
}
})
</script>
</body>
</html>
댓글
댓글 쓰기