Kaynağa Gözat

默认路由重定向

yf_zd 5 yıl önce
ebeveyn
işleme
009bed68eb

+ 1 - 8
bigdata2/src/components/Index.vue

@@ -157,18 +157,11 @@ export default {
 	},
 	created: function () {
 		this.getuserinfo()
+		// this.$router.push('xycb')
 	},
 	computed: {
 	},
 	watch: {
-		'$route.path': function (newVal) {
-			if (
-				newVal == '/index/home' ||
-				newVal == '/index/home02' ||
-				newVal == '/index/mapView'
-			) {
-			}
-		}
 	},
 	mounted() {
 	},

+ 6 - 2
bigdata2/src/router/index.js

@@ -44,11 +44,15 @@ Vue.use(Router)
 export default new Router({
   routes: [{
       path:'',
-      component: Index,
+      redirect: '/index'
     },{
     path: '/index',
     component: Index,
-    children: [{
+    children: [
+      {
+        path: '',
+        redirect: '/index/xycb'
+      },{
         path: 'personMsg',
         component: PersonMsg
       },