提交 b40a1a94 编写于 作者: D DCloud_LXH

wip: search page

上级 720efbf6
......@@ -36,7 +36,7 @@ const config = {
apiKey: '2fdcc4e76c8e260671ad70065e60b2e7',
indexName: 'zh-uniapp',
appId: 'PQIR5NL8CZ',
searchParameters: { hitsPerPage: 40 }
searchParameters: { hitsPerPage: 50 }
}
},
markdown: {
......
......@@ -75,7 +75,7 @@
},
};
</script>
<style lang="stylus">
<style lang="stylus" scoped>
.DocSearch-Hit
border-radius 4px
display flex
......
......@@ -29,7 +29,7 @@
methods: {},
};
</script>
<style lang="stylus">
<style lang="stylus" scoped>
.DocSearch-Hits mark {
background: none;
color: $accentColor;
......
......@@ -16,11 +16,11 @@
class="search-input"
:placeholder="placeholder"
type="text"
@keydown.enter="search"
@keydown.enter="resetSearchPage, search"
v-model="searchValue"
/>
<span class="search-input-btn">
<button @click="search">
<button @click="resetSearchPage, search">
<svg
width="16"
height="16"
......@@ -172,12 +172,15 @@
},
searchValue: debounce(function () {
this.searchPage = 0;
this.resetSearchPage();
this.search();
}, 300),
},
methods: {
resetSearchPage() {
this.searchPage = 0;
},
research(curPage) {
this.searchPage = curPage - 1;
this.search();
......@@ -286,6 +289,6 @@
};
</script>
<style lang="stylus">
<style lang="stylus" scoped>
@import './index'
</style>
......@@ -312,6 +312,6 @@
};
</script>
<style lang="stylus">
<style lang="stylus" scoped>
@import '../styles/footer.styl'
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册