父组件传递值给子组件(一)
生活随笔
收集整理的這篇文章主要介紹了
父组件传递值给子组件(一)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
父組件 App.vue
<template>
<div>
<header-vue :msg="msg"></header-vue>
<body-vue></body-vue>
<footer-vue></footer-vue>
</div>
</template>
<script>
export default{
data(){
return{
msg:"這是一個aaa"
}
},
methods:{
}
}
</script>
<style>
</style>
?
子組件header.vue
<template>
<div>頭部{{msg}}</div>
</template>
<script>
export default{
data(){
return{
}
},
props:['msg']
}
</script>
<style scoped>
div{
background: blue;
}
</style>
轉載于:https://www.cnblogs.com/zhousen34/p/7641745.html
總結
以上是生活随笔為你收集整理的父组件传递值给子组件(一)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 加快liferay 7的启动速度
- 下一篇: Python-OpenCV快速教程