搜索框bug修复
This commit is contained in:
parent
093f3d2dfa
commit
fedaac2d9f
@ -23,14 +23,14 @@
|
|||||||
<div class="tools-wrap">
|
<div class="tools-wrap">
|
||||||
<%if(hasInnerArchive){%>
|
<%if(hasInnerArchive){%>
|
||||||
<section class="tools-section tools-section-all" v-show="innerArchive">
|
<section class="tools-section tools-section-all" v-show="innerArchive">
|
||||||
<div class="search-wrap" @click="$refs.searchIpt.focus()">
|
<div class="search-wrap" >
|
||||||
<span :class="'search-item'" v-for="(searchItem,index) in searchItems" :key="index">
|
<span :class="'search-item'" v-for="(searchItem,index) in searchItems" :key="index">
|
||||||
<i class="icon icon-book" v-if="searchItem.type === 'category'"></i>
|
<i class="icon icon-book" v-if="searchItem.type === 'category'"></i>
|
||||||
<i class="icon icon-price-tags" v-if="searchItem.type === 'tag'"></i>
|
<i class="icon icon-price-tags" v-if="searchItem.type === 'tag'"></i>
|
||||||
{{searchItem.query}}
|
{{searchItem.query}}
|
||||||
<i class="icon icon-close" @click="searchItems.splice(index,1)"></i>
|
<i class="icon icon-close" @click="searchItems.splice(index,1)"></i>
|
||||||
</span>
|
</span>
|
||||||
<input class="search-ipt" ref="searchIpt" v-model="search" @blur="addSearchItem(search)" @keydown="searchKeydown" type="text" placeholder="<%=__('search') %>…">
|
<input class="search-ipt" v-model="search" @blur="addSearchItem(search)" @keydown="searchKeydown" type="text" placeholder="<%=__('search') %>…">
|
||||||
<i class="icon icon-search" @click="addSearchItem(search)"></i>
|
<i class="icon icon-search" @click="addSearchItem(search)"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="widget tagcloud search-tag">
|
<div class="widget tagcloud search-tag">
|
||||||
|
|||||||
@ -256,7 +256,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
%anmCommon {
|
%anmCommon {
|
||||||
animation-duration: .3s;
|
animation-duration: .5s;
|
||||||
animation-fill-mode: both;
|
animation-fill-mode: both;
|
||||||
animation-timing-function: ease-in-out;
|
animation-timing-function: ease-in-out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,15 +40,15 @@ html, body, #container {
|
|||||||
min-height:100%;
|
min-height:100%;
|
||||||
background:$colorBodyBg;
|
background:$colorBodyBg;
|
||||||
left: 300px;
|
left: 300px;
|
||||||
width: auto;
|
width: auto;
|
||||||
@extend %trans;
|
@extend %trans;
|
||||||
&.show {
|
&.show {
|
||||||
background: none;
|
background: none;
|
||||||
opacity: .9;
|
opacity: .9;
|
||||||
@extend %anmLeftIn;
|
@extend %anmLeftIn;
|
||||||
.article {
|
.article {
|
||||||
@extend %trans;
|
transition: opacity .5s ease-in, background-color .2s ease-in;
|
||||||
background: rgba(255,255,255,.3);
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.hide {
|
&.hide {
|
||||||
|
|||||||
@ -38,7 +38,6 @@
|
|||||||
border-bottom: 2px solid $colorF;
|
border-bottom: 2px solid $colorF;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
cursor: text;
|
|
||||||
.search-ipt {
|
.search-ipt {
|
||||||
color: $colorF;
|
color: $colorF;
|
||||||
background: none;
|
background: none;
|
||||||
@ -64,6 +63,8 @@
|
|||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
background-color: #076773;
|
background-color: #076773;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 25px;
|
||||||
>.icon-close {
|
>.icon-close {
|
||||||
color: darken($colorF, 15%);
|
color: darken($colorF, 15%);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|||||||
@ -77,7 +77,7 @@ new Vue({
|
|||||||
console.log(event.keyCode)
|
console.log(event.keyCode)
|
||||||
if(event.keyCode == 13){ // 回车键
|
if(event.keyCode == 13){ // 回车键
|
||||||
this.addSearchItem(this.search)
|
this.addSearchItem(this.search)
|
||||||
} else if(event.keyCode == 8) { // 退格键
|
} else if(event.keyCode == 8 && !this.search) { // 退格键
|
||||||
this.searchItems.pop()
|
this.searchItems.pop()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user