Vuejs——组件——props数据传递
2021-06-22 18:05
阅读:554
标签:传递 data pre com 属性 nbsp exp 数据 数据传递
父组件向子组件传递:
wapper.vue父组件
template>
div>
input type="text" v-model="msg">
br>
child :inputValue="msg">child>
div>
template>
style>
style>
script>
export default{
data(){
return {
msg: ‘请输入‘
}
},
components: {
child: require(‘./Child.vue‘)
}
}
script>
child.vue子组件
template>
div>
p>{{inputValue}}p>
div>
template>
style>
style>
script>
export default{
props: {
inputValue: String
}
}
script>
Vuejs——组件——props数据传递
标签:传递 data pre com 属性 nbsp exp 数据 数据传递
原文地址:http://www.cnblogs.com/queenaq/p/7169144.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:Vuejs——组件——props数据传递
文章链接:http://soscw.com/index.php/essay/97492.html
文章标题:Vuejs——组件——props数据传递
文章链接:http://soscw.com/index.php/essay/97492.html
评论
亲,登录后才可以留言!