From 8b87d79f47562d6113e8c18c0b9db25be083d1ea Mon Sep 17 00:00:00 2001 From: lin-xin Date: Thu, 26 Jul 2018 17:26:43 +0800 Subject: [PATCH] =?UTF-8?q?'tags=E6=A0=8F=E4=BF=9D=E6=8C=81=E5=9C=A8?= =?UTF-8?q?=E9=A1=B6=E9=83=A8/tags=E6=A0=87=E7=AD=BE=E6=9C=80=E5=A4=9A?= =?UTF-8?q?=E6=98=BE=E7=A4=BA8=E4=B8=AA'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Tags.vue | 16 +++++++++++----- static/css/main.css | 4 +++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/common/Tags.vue b/src/components/common/Tags.vue index d87fc42..da724e4 100644 --- a/src/components/common/Tags.vue +++ b/src/components/common/Tags.vue @@ -61,11 +61,16 @@ const isExist = this.tagsList.some(item => { return item.path === route.fullPath; }) - !isExist && this.tagsList.push({ - title: route.meta.title, - path: route.fullPath, - name: route.matched[1].components.default.name - }) + if(!isExist){ + if(this.tagsList.length >= 8){ + this.tagsList.shift(); + } + this.tagsList.push({ + title: route.meta.title, + path: route.fullPath, + name: route.matched[1].components.default.name + }) + } bus.$emit('tags', this.tagsList); }, handleTags(command){ @@ -97,6 +102,7 @@ overflow: hidden; background: #fff; padding-right: 120px; + box-shadow: 0 5px 10px #ddd; } .tags ul { diff --git a/static/css/main.css b/static/css/main.css index 68cc36b..3ae9fa6 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -26,7 +26,6 @@ a { right: 0; top: 70px; bottom: 0; - overflow-y: scroll; -webkit-transition: left .3s ease-in-out; transition: left .3s ease-in-out; background: #f0f0f0; @@ -34,7 +33,10 @@ a { .content { width: auto; + height: 100%; padding: 40px; + overflow-y: scroll; + box-sizing: border-box; } .content-collapse {