- 可以传递任何数据,包括函数
- 整个父组件的实例this
父组件Home:
<template>
子组件:<header :属性='值' :home="this"></header>//this表示把整个父组件传递给子组件
</template>
子组件:
<script>
<template>{{this.home.属性}}</template>//子组件访问父组件已经定义好的数据
export default{
props:{
home:Object//
}
}
子组件直接获取父组件数据:this.$parent.xxx
</script>