🐛 搜索面板优化
Former-commit-id: 954c685d9c6a7928a9f6b8c8f36879d6e8210e5a
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
// 过渡动画 缩放渐变
|
// 过渡动画 缩放渐变
|
||||||
.fade-scale-leave-active,
|
.fade-scale-leave-active,
|
||||||
.fade-scale-enter-active {
|
.fade-scale-enter-active {
|
||||||
transition: all .5s;
|
transition: all .3s;
|
||||||
}
|
}
|
||||||
.fade-scale-enter {
|
.fade-scale-enter {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|||||||
@@ -122,7 +122,9 @@ export default {
|
|||||||
focus () {
|
focus () {
|
||||||
this.input = ''
|
this.input = ''
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
if (this.$refs.input) {
|
||||||
this.$refs.input.focus()
|
this.$refs.input.focus()
|
||||||
|
}
|
||||||
// 还原
|
// 还原
|
||||||
this.searchText = ''
|
this.searchText = ''
|
||||||
this.results = []
|
this.results = []
|
||||||
@@ -185,6 +187,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.panel-search {
|
.panel-search {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
|
width: 100%;
|
||||||
.panel-search__input-group {
|
.panel-search__input-group {
|
||||||
height: 240px;
|
height: 240px;
|
||||||
.panel-search__logo {
|
.panel-search__logo {
|
||||||
@@ -212,6 +215,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.panel-search__results-group {
|
.panel-search__results-group {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
margin-bottom: -20px;
|
||||||
.panel-search__results-group-inner {
|
.panel-search__results-group-inner {
|
||||||
margin: -20px;
|
margin: -20px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
<div class="d2-theme-container-main" flex-box="1" flex>
|
<div class="d2-theme-container-main" flex-box="1" flex>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<transition name="fade-scale">
|
<transition name="fade-scale">
|
||||||
<div v-show="searchActive" class="d2-theme-container-main-layer" flex="dir:top">
|
<div v-if="searchActive" class="d2-theme-container-main-layer" flex>
|
||||||
<d2-panel-search
|
<d2-panel-search
|
||||||
ref="panelSearch"
|
ref="panelSearch"
|
||||||
@close="searchPanelClose"/>
|
@close="searchPanelClose"/>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
</transition>
|
</transition>
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<transition name="fade-scale">
|
<transition name="fade-scale">
|
||||||
<div v-show="!searchActive" class="d2-theme-container-main-layer" flex="dir:top">
|
<div v-if="!searchActive" class="d2-theme-container-main-layer" flex="dir:top">
|
||||||
<!-- tab -->
|
<!-- tab -->
|
||||||
<div class="d2-theme-container-main-header" flex-box="0">
|
<div class="d2-theme-container-main-header" flex-box="0">
|
||||||
<d2-tabs/>
|
<d2-tabs/>
|
||||||
|
|||||||
@@ -39,14 +39,22 @@ export default {
|
|||||||
handleSearchClick () {
|
handleSearchClick () {
|
||||||
this.searchToggle()
|
this.searchToggle()
|
||||||
if (this.searchActive) {
|
if (this.searchActive) {
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.$refs.panelSearch) {
|
||||||
this.$refs.panelSearch.focus()
|
this.$refs.panelSearch.focus()
|
||||||
}
|
}
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
searchPanelOpen () {
|
searchPanelOpen () {
|
||||||
if (!this.searchActive) {
|
if (!this.searchActive) {
|
||||||
this.searchSet(true)
|
this.searchSet(true)
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.$refs.panelSearch) {
|
||||||
this.$refs.panelSearch.focus()
|
this.$refs.panelSearch.focus()
|
||||||
}
|
}
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 关闭搜索面板
|
// 关闭搜索面板
|
||||||
searchPanelClose () {
|
searchPanelClose () {
|
||||||
|
|||||||
Reference in New Issue
Block a user