Skip to content

Commit c3eb6a6

Browse files
author
reco_luan
committed
fix: fix small bugs
1 parent 1eb7517 commit c3eb6a6

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

components/AlgoliaSearchBox.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@
77
<input
88
id="algolia-search-input"
99
class="search-query"
10+
:placeholder="placeholder"
1011
>
1112
</form>
1213
</template>
1314

1415
<script>
1516
export default {
1617
props: ['options'],
17-
18+
data () {
19+
return {
20+
placeholder: undefined
21+
}
22+
},
1823
mounted () {
1924
this.initialize(this.options, this.$lang)
25+
this.placeholder = this.$site.themeConfig.searchPlaceholder || ''
2026
},
2127
2228
methods: {
@@ -35,7 +41,11 @@ export default {
3541
// #697 Make docsearch work well at i18n mode.
3642
algoliaOptions: Object.assign({
3743
'facetFilters': [`lang:${lang}`].concat(algoliaOptions.facetFilters || [])
38-
}, algoliaOptions)
44+
}, algoliaOptions),
45+
handleSelected: (input, event, suggestion) => {
46+
const { pathname, hash } = new URL(suggestion.url)
47+
this.$router.push(`${pathname}${hash}`)
48+
}
3949
}
4050
))
4151
})

components/HomeBlog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</li>
4646
</ul>
4747
<hr>
48-
<h4><i class="iconfont reco-tag"></i> 标签</h4>
48+
<h4 v-if="$tags.list.length !== 0"><i class="iconfont reco-tag"></i> 标签</h4>
4949
<TagList @getCurrentTag="getPagesByTags"></TagList>
5050
</div>
5151
</div>

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-theme-reco",
3-
"version": "1.1.1-alpha.2",
3+
"version": "1.1.1-alpha.3",
44
"description": "A simple and beautiful vuepress Blog & Doc theme.",
55
"main": "index.js",
66
"scripts": {
@@ -27,14 +27,15 @@
2727
"_resolved": "http://registry.npm.taobao.org/vuepress-theme-reco/download/vuepress-theme-reco-0.2.1.tgz",
2828
"dependencies": {
2929
"@vuepress-reco/vuepress-plugin-back-to-top": "^1.0.3",
30-
"@vuepress-reco/vuepress-plugin-extract-code": "1.0.1",
30+
"@vuepress-reco/vuepress-plugin-extract-code": "^1.0.3",
3131
"@vuepress-reco/vuepress-plugin-loading-page": "^1.0.0",
3232
"@vuepress-reco/vuepress-plugin-pagation": "^1.0.3",
3333
"@vuepress-reco/vuepress-plugin-screenfull": "^1.0.0",
3434
"@vuepress-reco/vuepress-plugin-ga": "^1.0.2",
35-
"@vuepress-reco/vuepress-plugin-comments": "^1.0.6",
35+
"@vuepress-reco/vuepress-plugin-comments": "^1.0.7",
3636
"@vuepress/plugin-medium-zoom": "1.2.0",
3737
"@vuepress/plugin-blog": "1.3.0",
38+
"docsearch.js": "^2.5.2",
3839
"leancloud-storage": "3.13.2",
3940
"valine": "1.3.6",
4041
"vue-click-outside": "1.0.7"

0 commit comments

Comments
 (0)