vue.js 22-2
<html>
<head>
<title>test22</title>
</head>
<body>
<div id="app">
<child-component v-bind:propsdata="msg1"></child-component>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
var component1 ={
template:"<div>hello{{msg2}} {{propsdata}}</div>",
props:['propsdata'],
data:function(){
return {
msg2 : '111'
}
}
}
new Vue({
el:'#app',
data:{
msg1:'안녕!!'
},
components:{
'child-component':component1
}
})
</script>
</body>
</html>
댓글
댓글 쓰기