滚动行为
new router({
scrollBehavior (to, from, savaPosition) {
if(savePosition) { ? ? ? //歷史記錄的前進后退記住的之前滾動到的位置
return savePosition
} else {
return {x: 0, y: 0}
}
//history模式下 定位到某個元素失效的解決辦法
if(to.hash) {
return {
selector: to.hash
}
} else {
return {x: 0, y: 0}
}
}
})
轉載于:https://www.cnblogs.com/jessicaWy/p/7256914.html
總結
- 上一篇: 2017年秋招-广联达面试及思考
- 下一篇: Java猿面试_猿灯塔:关于Java面试