What if the removeEventListener remove scrolling event does not work after the vue route is redirected?

After the

Bug:A page routes to page B, the removal of the "scroll bar drop down to the bottom to load more" event does not take effect, and the interface of page An is still being requested from the bottom of the B page scroll bar. The
code is as follows:


        methods: {
            //B
              goCommodityDetails(e){
                  window.removeEventListener("scroll", this.addEventScrollTop ,true)
                  this.$router.push({
                    path: "/commodityDetails",
                    query: {
                        t: Math.random(),
                        id: e.id
                    }
                });
              },
          },
          created () {
            window.addEventListener("scroll", this.addEventScrollTop ,true)
          },
          mounted () {

          },
          updated() {
 
          },
          destroyed(){
              window.removeEventListener("scroll", this.addEventScrollTop ,true)
          }
Jul.15,2021

//window.removeEventListener('scroll', this.addEventScrollTop ,true)
window.removeEventListener('scroll', this.addEventScrollTop ,false)

the same problem has just been solved


beforeRouteLeave
beforeRouteLeave(to,from,next){
    window.removeEventListener('scroll', this.addEventScrollTop ,true);
    this.$router.push({
       path: '/commodityDetails',
           query: {
            t: Math.random(),
             id: e.id
              }
         });
    next();// next()
}

didn't try remove? when beforedestroy is the hook.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4ff3b-45072.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4ff3b-45072.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?