<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="js/vue-1.0.24.debug.js"></script>
</head>
<body>
<div>
<child msg="hello_vue"></child>
</div>
<div style="margin-top:50px;">
<input type="text" v-model="inputMsg">
<br>
<children :input-msg="inputMsg"></children>
</div>
<script>
//1.父子组件props传参
Vue.component('child',{
props:['msg'],
template:'<span>{{msg}}</span>'
})
//2.props动态传参
Vue.component('children',{
props:['inputMsg'],
template:'<span>{{inputMsg}}</span>'
})
new Vue({
el:'body',
data:{
inputMsg:"hello_vue"
}
})
</script>
</body>
</html>
//例1:父子组件props进行传参,在绑定属性是直接写xxx=" ",
//例2:props动态传参,在绑定属性是v-on:xxx = "(v-model传的参数)"