router.js path{} // 子路由 children:[ {path:''}, ] redirect: 默认显示路由children: 子路由router-view复用hmtl<router-view name='histroy'>{path:'/',components:{ default:Home, 'history':History}}
返回页面之前浏览位置
滚动行为,需要页面有足够高度,并且浏览器需要支持history.pushStateconst,mode:'history',scrollBehavior(to, from, savedPosition){ // return {x:0, y=100} // return {selector:'.xxx'} // 判断是否有savePosition行为,返回之前页面的浏览高度 if (savePosition) { return savePosition }else { return {x:0, y=0} }}
posted on 2019-03-15 13:02 帝幂弦 阅读( ...) 评论( ...) 编辑 收藏
转载于:https://www.cnblogs.com/dreamMargin/p/10536375.html
