Merge branch 'dev' into next

This commit is contained in:
chenjiahan
2020-09-27 15:34:57 +08:00
10 changed files with 196 additions and 11 deletions
-1
View File
@@ -108,7 +108,6 @@ export default {
.van-doc-intro {
padding-top: 20px;
font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
text-align: center;
p {
@@ -90,7 +90,7 @@ export default {
},
anotherLang() {
const items = this.langConfigs.filter(item => item.lang !== this.lang);
const items = this.langConfigs.filter((item) => item.lang !== this.lang);
if (items.length) {
return items[0];
}
@@ -178,7 +178,6 @@ export default {
padding: 0 12px;
color: #fff;
font-size: 14px;
font-family: 'Helvetica Neue', Arial, sans-serif;
line-height: 24px;
text-align: center;
border: 1px solid rgba(255, 255, 255, 0.7);
@@ -29,6 +29,17 @@ export default {
if (this.searchConfig) {
this.docsearchInstance = window.docsearch({
...this.searchConfig,
transformData: (hits) => {
hits.forEach((hit) => {
if (hit.anchor) {
hit.url = hit.url + '#' + hit.anchor;
hit.anchor = null;
}
});
if (this.searchConfig.transformData) {
this.searchConfig.transformData(hits);
}
},
inputSelector: '.van-doc-search',
algoliaOptions: {
facetFilters: [`lang:${this.lang}`],