How to call function on child component on parent events

后端 未结 9 1094
陌清茗
陌清茗 2020-11-27 09:16

Context

In Vue 2.0 the documentation and others clearly indicate that communication from parent to child happens via props.

Question

How does a p

9条回答
  •  孤城傲影
    2020-11-27 10:21

    you can use key to reload child component using key

    
    

    If you want to reload component with new filter, if button click filter the child component

    reloadData() {            
       this.filter = ['filter1','filter2']
       this.componentKey += 1;  
    },
    

    and use the filter to trigger the function

提交回复
热议问题