提交 b40a1a94 编写于 作者: D DCloud_LXH

wip: search page

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