Merge pull request #674 from h3poteto/narrow-design

Fix side menu design for narrow style
This commit is contained in:
AkiraFukushima 2018-10-23 08:24:38 +09:00 committed by GitHub
commit 24a299148d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 14 deletions

View File

@ -36,52 +36,54 @@
:router="true"
:class="collapse ? 'el-menu-vertical timeline-menu narrow-menu':'el-menu-vertical timeline-menu'"
role="menu">
<el-menu-item :index="`/${id()}/home`" role="menuitem">
<el-menu-item :index="`/${id()}/home`" role="menuitem" :title="$t('side_menu.home')">
<icon name="home"></icon>
<span>{{ $t("side_menu.home") }}</span>
<el-badge is-dot :hidden="!unreadHomeTimeline">
</el-badge>
</el-menu-item>
<el-menu-item :index="`/${id()}/notifications`" role="menuitem">
<el-menu-item :index="`/${id()}/notifications`" role="menuitem" :title="$t('side_menu.notification')">
<icon name="bell"></icon>
<span>{{ $t("side_menu.notification") }}</span>
<el-badge is-dot :hidden="!unreadNotifications">
</el-badge>
</el-menu-item>
<el-menu-item :index="`/${id()}/favourites`" role="menuitem">
<el-menu-item :index="`/${id()}/favourites`" role="menuitem" :title="$t('side_menu.favourite')">
<icon name="star"></icon>
<span>{{ $t("side_menu.favourite") }}</span>
</el-menu-item>
<el-menu-item :index="`/${id()}/local`" role="menuitem">
<el-menu-item :index="`/${id()}/local`" role="menuitem" :title="$t('side_menu.local')">
<icon name="users"></icon>
<span>{{ $t("side_menu.local") }}</span>
<el-badge is-dot :hidden="!unreadLocalTimeline">
</el-badge>
</el-menu-item>
<el-menu-item :index="`/${id()}/public`" role="menuitem">
<el-menu-item :index="`/${id()}/public`" role="menuitem" :title="$t('side_menu.public')">
<icon name="globe"></icon>
<span>{{ $t("side_menu.public") }}</span>
</el-menu-item>
<el-menu-item :index="`/${id()}/search`" role="menuitem">
<el-menu-item :index="`/${id()}/search`" role="menuitem" :title="$t('side_menu.search')">
<icon name="search"></icon>
<span>{{ $t("side_menu.search") }}</span>
</el-menu-item>
<el-menu-item :index="`/${id()}/hashtag`" role="menuitem">
<el-menu-item :index="`/${id()}/hashtag`" role="menuitem" :title="$t('side_menu.hashtag')">
<icon name="hashtag"></icon>
<span>{{ $t("side_menu.hashtag") }}</span>
</el-menu-item>
<template v-for="tag in tags">
<el-menu-item :index="`/${id()}/hashtag/${tag.tagName}`" class="sub-menu" :key="tag.tagName" role="menuitem">
<span>#{{ tag.tagName }}</span>
<el-menu-item :index="`/${id()}/hashtag/${tag.tagName}`" :class="collapse ? '' : 'sub-menu'" :key="tag.tagName" role="menuitem" :title="tag.tagName">
<icon name="hashtag" scale="0.8"></icon>
<span>{{ tag.tagName }}</span>
</el-menu-item>
</template>
<el-menu-item :index="`/${id()}/lists`" role="menuitem">
<el-menu-item :index="`/${id()}/lists`" role="menuitem" :title="$t('side_menu.lists')">
<icon name="list-ul"></icon>
<span>{{ $t("side_menu.lists") }}</span>
</el-menu-item>
<template v-for="list in lists">
<el-menu-item :index="`/${id()}/lists/${list.id}`" class="sub-menu" :key="list.id" role="menuitem">
<span>#{{ list.title }}</span>
<el-menu-item :index="`/${id()}/lists/${list.id}`" :class="collapse ? '' : 'sub-menu'" :key="list.id" role="menuitem" :title="list.title">
<icon name="list-ul" scale="0.8"></icon>
<span>{{ list.title }}</span>
</el-menu-item>
</template>
</el-menu>
@ -201,6 +203,7 @@ export default {
.release-collapse {
color: #dcdfe6;
padding: 0;
margin-left: -10px;
&:hover {
color: #409eff;
@ -241,8 +244,18 @@ export default {
}
}
.narrow-menu {
width: 76px;
.narrow-menu /deep/ {
width: 64px;
.el-menu-item {
margin-left: 4px;
}
.el-badge {
vertical-align: top;
line-height: 32px;
margin-left: -8px;
}
}
}
</style>