From 040c9d8538f2d0bd85ebd6b271cb5268fab32328 Mon Sep 17 00:00:00 2001 From: Pan Date: Mon, 27 May 2019 15:46:03 +0800 Subject: [PATCH] refine demo --- src/views/tab/index.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/views/tab/index.vue b/src/views/tab/index.vue index da0291d7..6438a47a 100644 --- a/src/views/tab/index.vue +++ b/src/views/tab/index.vue @@ -35,6 +35,13 @@ export default { this.$router.push(`${this.$route.path}?tab=${val}`) } }, + created() { + // init the default selected tab + const tab = this.$route.query.tab + if (tab) { + this.activeName = tab + } + }, methods: { showCreatedTimes() { this.createdTimes = this.createdTimes + 1