From f7bbc6a9e9e878cf87075993933b8e3f48197ece Mon Sep 17 00:00:00 2001 From: Pan Date: Sun, 30 Sep 2018 16:02:50 +0800 Subject: [PATCH] tweak --- src/views/layout/components/TagsView.vue | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/views/layout/components/TagsView.vue b/src/views/layout/components/TagsView.vue index 29be78fe..eefb5457 100644 --- a/src/views/layout/components/TagsView.vue +++ b/src/views/layout/components/TagsView.vue @@ -61,21 +61,15 @@ export default { }, methods: { generateTitle, // generateTitle by vue-i18n - generateRoute() { - if (this.$route.name) { - return this.$route - } - return false - }, isActive(route) { return route.path === this.$route.path }, addViewTags() { - const route = this.generateRoute() - if (!route) { - return false + const { name } = this.$route + if (name) { + this.$store.dispatch('addView', this.$route) } - this.$store.dispatch('addView', route) + return false }, moveToCurrentTag() { const tags = this.$refs.tag