Vue-router Positioning to Anchor Point problem

the scrollBehavior implementation of vue-router is used in the project to navigate to the anchor point, which is already used under history mode. The address bar is already localhost:8080/home/basicInfo-sharpvideo, but it is not immediately located but needs to be refreshed to locate the location of the video. No, no, no.
the configuration of scrollBehavior is official: https://github.com/vuejs/vue-.

roughly speaking, there is a parent menu in the parent component to toggle the content displayed in the router-view, while the child menu is to locate the component in the router-view

Mar.03,2021

according to ide/advanced/scroll-behavior.html-sharp%E6%BB%9A%E5%8A%A8%E8%A1%8C%E4%B8%BA" rel=" nofollow noreferrer "> Vue Router scrolling behavior and example :

const scrollBehavior = function (to, from, savedPosition) {
  if (to.hash) {
    return {
      //  to.hash 
      selector: to.hash
    }
  }
}
const router = new Router({
  routes: routers,
  mode: 'history',
  base: '/',
  scrollBehavior
})

in the menu of the parent component:

<router-link :to="/xxx-sharp0">00000</router-link>
<router-link :to="/xxx-sharp1">00000</router-link>

in the corresponding module of the subcomponent:

<div class="moudle" id="0"></div>
<div class="moudle" id="1"></div>

this enables anchor positioning in history mode.

Menu