vue 父子传值

1. .sync

2.ref

this.$refs.remindPage.setNotice(this.noticeCache);
this.$refs.子组件refName.子组件api();

3.props

//子组件定义
    props: {
      noticeCache: {
        type: Object,
        default: function() {
          return {}
        }
      }
    },

    console.log(this.noticeCache);
//父组件传值
<components-demo
   ref="remindPage"
   :noticeCache.sync="noticeCache"
   >
   </components-demo>

4.$emit

原文地址:https://www.cnblogs.com/jy17/p/15353784.html