vue 子组件调用父组件方法
父组件vueprivateScoreTop:msg ="Widget" v-on:listenTochildEvent="showMessageFromChild">privateScoreTop>父组件jsexport default{data(){return {}},computed:{p
·
父组件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",{回传参数});
},
}
}
更多推荐
已为社区贡献16条内容
所有评论(0)