Force refresh child component in parent component

Background: The parent component is cached. When the parent component is activated, the child component is refreshed.
Step
1. Add the key attribute to the child component
insert image description here

 <Multpicker @submitBtn="getmonth" @resetBtn="resetmonth" :key="timer"></Multpicker>

2. In the activated hook of the parent component, assign the current time to the timer
insert image description here

activated() {
    this.timer = new Date().getTime()
    }

Guess you like

Origin blog.csdn.net/qq_45791799/article/details/126644290