|
@ -100,6 +100,31 @@ const whiteList = [
|
|
|
const router = new VueRouter({
|
|
|
mode: 'history',
|
|
|
base: process.env.BASE_URL,
|
|
|
scrollBehavior (to, from, savedPosition) {
|
|
|
if(to.meta.savedPosition ) { //&& isKeepAlive(to)
|
|
|
let count = 0
|
|
|
let timmer = setInterval(() => {
|
|
|
if(count > 2) {
|
|
|
window.scrollTo(0 , to.meta.savedPosition)
|
|
|
window.clearInterval(timmer)
|
|
|
timmer = null
|
|
|
return
|
|
|
}
|
|
|
count++
|
|
|
window.scrollTo(0 , to.meta.savedPosition)
|
|
|
}, 300)
|
|
|
} else {
|
|
|
// window.scrollTo(0 , 0)
|
|
|
}
|
|
|
if (savedPosition) {
|
|
|
return savedPosition
|
|
|
} else {
|
|
|
// if (isKeepAlive(from)) {
|
|
|
from.meta.savedPosition = (document.documentElement|| document.body).scrollTop
|
|
|
// }
|
|
|
return { x: 0, y: to.meta.savedPosition || 0 }
|
|
|
}
|
|
|
},
|
|
|
routes: routes.concat( personal, order, replenishment, device, machine )
|
|
|
})
|
|
|
|