From 56fe690507efc7e47f3b83e4e2095afa1ccf1439 Mon Sep 17 00:00:00 2001
From: inleft <inleft@qq.com>
Date: Mon, 07 Mar 2022 01:29:57 +0800
Subject: [PATCH] Dplayer测试

---
 src/router/router.js |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/router/router.js b/src/router/router.js
index 0a44ef4..de20598 100644
--- a/src/router/router.js
+++ b/src/router/router.js
@@ -12,11 +12,20 @@
 /*实例化路由*/
 const router = new Router({
 	mode: "history", //模式修改  
-	routes: asyncRouterMap
+	routes: asyncRouterMap,
+	scrollBehavior (to, from, savedPosition) {
+		
+		//路由切换是否滚动到顶部
+	   if (savedPosition) {
+	     return savedPosition
+	    } else {
+	     return { x: 0, y: 0 }
+	    }
+	}
 })
 
 router.beforeEach((to, from, next) => {
-	window.document.title = to.meta.title == undefined?'默认标题':to.meta.title
+	window.document.title = to.meta.title == undefined?'在你左边,听风及雨':to.meta.title
 	next();
 })
 

--
Gitblit v1.9.1