父组件vue

<privateScoreTop  :msg ="Widget" v-on:listenTochildEvent="showMessageFromChild">
</privateScoreTop>

父组件js

export default{
    data(){
        return {
        }
    },
    computed:{
      privateScoreTop : ()=>import("./privateScoreTop.vue")  
    },
    mounted(){
    },
    methods:{
      showMessageFromChild(data){
         console.log("回掉子组件成功"+data);
     }  
    }
}

子组件js

export default{
    methods: {
      onfilter(){
          this.$emit("listenTochildEvent",{回传参数});
       },
    }
}
Logo

前往低代码交流专区

更多推荐