refs #355 Add back button in tag page

This commit is contained in:
AkiraFukushima 2018-06-01 12:34:46 +09:00
parent 1d1839a0ea
commit d6ee7b3578
2 changed files with 52 additions and 15 deletions

View File

@ -1,8 +1,22 @@
<template>
<div id="hashtag">
<div class="search-header" v-loading="false">
<el-form :ineline="true">
<input v-model="tag" placeholder="Tag name" class="search-keyword" v-shortkey="['enter']" @shortkey="search" autofocus></input>
<el-form>
<div class="form-wrapper">
<div class="form-item" v-show="tagPage()">
<el-button type="text" @click="back">
<icon name="chevron-left"></icon>
</el-button>
</div>
<div class="form-item input">
<input v-model="tag" placeholder="Tag name" class="search-keyword" v-shortkey="['enter']" @shortkey="search" autofocus></input>
</div>
<div class="form-item" v-show="tagPage()">
<el-button type="text">
<icon name="thumbtack"></icon>
</el-button>
</div>
</div>
</el-form>
</div>
<router-view></router-view>
@ -23,6 +37,12 @@ export default {
},
search () {
this.$router.push({ path: `/${this.id()}/hashtag/${this.tag}` })
},
tagPage () {
return this.$route.name === 'tag'
},
back () {
this.$router.push({ name: 'hashtag-list' })
}
}
}
@ -36,18 +56,35 @@ export default {
background-color: var(--theme-selected-background-color);
padding: 8px 12px;
.search-keyword {
width: 100%;
background-color: var(--theme-background-color);
border: none;
border-radius: 0 4px 4px 0;
color: var(--theme-primary-color);
line-height: 40px;
height: 40px;
padding: 0 15px;
outline: 0;
font-size: 14px;
box-sizing: border-box;
.form-wrapper {
display: flex;
align-items: center;
.input {
flex-grow: 3;
}
.form-item {
margin: auto 8px;
.el-button {
padding: 0;
}
}
.search-keyword {
width: 100%;
background-color: var(--theme-background-color);
border: none;
border-radius: 0 4px 4px 0;
color: var(--theme-primary-color);
line-height: 40px;
height: 40px;
padding: 0 15px;
outline: 0;
font-size: 14px;
box-sizing: border-box;
}
}
}
}

View File

@ -16,7 +16,7 @@
</div>
</div>
<el-menu
:default-active="activeRoute"
default-active="activeRoute"
:background-color="themeColor"
text-color="#909399"
active-text-color="#ffffff"