can we call parent method from child component in vuejs

 we have two components

one is child componet and another one is pareant component


fetch is parent component 


another moderation .vue - its child

we import alert componet so its child

<submit-component
ref="submitComponent"
:max_submit_queue_count="max_submit_queue_count"
:direct_submit="direct_submit"
:multi_level_submit="multi_level_submit"
@onSubmit="afterSubmit()"
@onAlert="onAlert($event)"
@onSubmittedCount = SubmittedCount($event)
></submit-component>


v-on -> onsubmit event

afterSubmit(){
this.$refs.fetchComponent.autoFetch();
this.$refs.editorComponent.reload();
this.$refs.editorComponent.showThumbnailsTab();
},


fetchcomponent.vuie

autoFetch(){
if(!this.fetching && this.auto_fetch && this.my_queue_count < this.max_auto_fetch){
this.fetchAssignments(this.getRouteParams('level'));
this.createAssignmment(1);
}
},


No comments:

Post a Comment

React -1 ( react with ravenndra kanchi)

 react with tool chanis 45 to 50 sessions core  after 50 sessions -> some tooll chains == react with type script mern stackaplication in ...