vue-cli学习——子组件向父组件传值
更新:HHH   时间:2023-1-7


child.vue

    >.  <button @click="sendMsg">传递</button>

    >.  this.$emit("sendMsg",this.msg)

parent.vue

    >. <Child @sendmsg = "getMsg"/>

    >.  methods里定义事件函数名字

          getMag(data){

                console.log(data);

                this.info = data;

           }

    >. data 里定义 info : " "

返回web开发教程...