From 2646d5579dc83e08ea125548e09bb9f83fa16d4e Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Sun, 15 Mar 2020 17:40:26 +0800 Subject: [PATCH] vue-router: Use props Signed-off-by: Jianhui Zhao --- frontend/src/router/index.ts | 5 +++-- frontend/src/views/Home.vue | 2 +- frontend/src/views/Rtty.vue | 6 +++--- statik/statik.go | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 25a5c03..44c9fd7 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -18,9 +18,10 @@ const routes = [ component: Home }, { - path: '/rtty', + path: '/rtty/:devid', name: 'Rtty', - component: Rtty + component: Rtty, + props: true } ]; diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue index 3760351..50ccb0c 100644 --- a/frontend/src/views/Home.vue +++ b/frontend/src/views/Home.vue @@ -220,7 +220,7 @@ } connectDevice(devid: string) { - this.$router.push({path: '/rtty', query: {devid: devid}}); + this.$router.push({path: `/rtty/${devid}`}); } showCmdForm() { diff --git a/frontend/src/views/Rtty.vue b/frontend/src/views/Rtty.vue index a9950fc..b68e95e 100644 --- a/frontend/src/views/Rtty.vue +++ b/frontend/src/views/Rtty.vue @@ -14,7 +14,7 @@