提交 7e3de289 编写于 作者: D DCloud_LXH

wip: 样式调整

上级 b40a1a94
......@@ -75,17 +75,21 @@
},
};
</script>
<style lang="stylus" scoped>
<style lang="stylus">
.DocSearch-Hit
border-radius 4px
border-radius 0px
display flex
padding-bottom 4px
padding-bottom 0px
position relative
&:not(:first-child)
border-top 1px solid #f5f6f7
a
background var(--docsearch-hit-background)
border-radius 4px
box-shadow var(--docsearch-hit-shadow)
border-radius 0px
// box-shadow var(--docsearch-hit-shadow)
box-shadow none
display block
padding-left var(--docsearch-spacing)
width 100%
......@@ -117,6 +121,6 @@
font-size 0.9em
.DocSearch-Hit-path
color $accentColor
// color $accentColor
font-size 0.75em
</style>
......@@ -29,14 +29,19 @@
methods: {},
};
</script>
<style lang="stylus" scoped>
.DocSearch-Hits mark {
background: none;
color: $accentColor;
}
<style lang="stylus">
#docsearch-list{
border-radius: 10px;
padding: 0;
}
.DocSearch-Hits mark {
background: none;
color: $accentColor;
}
.DocSearch-Hit-source {
background-color $search-container-color;
color: $accentColor;
background-color $search-container-color;
color: $accentColor;
}
</style>
......@@ -133,8 +133,8 @@
resultList: [],
searchPage: 0, // 跳转页数
curHits: 0, // 当前搜索条数
totalPage: 0, // 搜索结果总共
curHits: 0, // 当前搜索结果总条数
totalPage: 0, // 搜索结果总共
curPage: 1, // 当前页
pageSize: 0, // 每页条数
};
......@@ -144,6 +144,9 @@
showPagination() {
return !!(this.resultList.length && this.totalPage > 1);
},
currentCategory() {
return this.category[this.categoryIndex];
},
},
mounted() {
......@@ -159,14 +162,13 @@
openSearch(val) {
this.$nextTick(() => {
if (val) {
this.$nextTick(forbidScroll);
forbidScroll();
document.body.appendChild(this.$el);
this.$nextTick(() => this.$refs.searchInput.focus());
} else {
this.cancel();
forbidScroll(false);
document.body.removeChild(this.$el);
// window.removeEventListener('keydown', this.onKeyDown);
}
});
},
......@@ -181,6 +183,7 @@
resetSearchPage() {
this.searchPage = 0;
},
research(curPage) {
this.searchPage = curPage - 1;
this.search();
......@@ -188,7 +191,7 @@
search() {
if (!this.searchValue) return;
const { text, type } = this.category[this.categoryIndex];
const { text, type } = this.currentCategory;
switch (type) {
case 'algolia':
this.searchByAlgolia(this.searchValue, this.searchPage).then(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册