In vue, exclude sets a component in keep-alive, and the subcomponents of this component do not execute activated?

app.vue
  <div id="app">
    <keep-alive exclude="Detail">
      <router-view/>
    </keep-alive>
  </div>
Detail.vueComm.vue
  activated () {
    window.addEventListener("scroll", this.handleScroll)
  },
  deactivated () {
    window.removeEventListener("scroll", this.handleScroll)
  }
In

vue, exclude sets a component in keep-alive, and the subcomponents of this component do not execute the activated function?
how should this code be modified?

Mar.21,2021

exclude is not cached, it's not created or mounted. Whether activated is for cached components


activated and deactivated will be triggered in all nested components within the < keep-alive > tree. Excluding components does not trigger

Menu