diff --git a/vant.config.js b/vant.config.js index a6a08d5cd..769a4afd0 100644 --- a/vant.config.js +++ b/vant.config.js @@ -39,26 +39,25 @@ module.exports = { url: 'https://github.com/youzan/vant', }, ], - // TODO - // searchConfig: { - // apiKey: '90067aecdaa2c85220e2783cd305caac', - // indexName: 'vant', - // searchParameters: { - // facetFilters: ['lang:zh-CN', 'version:v3'], - // }, - // transformItems(items) { - // if (location.hostname !== 'youzan.github.io') { - // items.forEach((item) => { - // if (item.url) { - // item.url = - // item.url && - // item.url.replace('youzan.github.io', location.hostname); - // } - // }); - // } - // return items; - // }, - // }, + searchConfig: { + apiKey: '90067aecdaa2c85220e2783cd305caac', + indexName: 'vant', + searchParameters: { + facetFilters: ['lang:zh-CN', 'version:v3'], + }, + transformItems(items) { + if (location.hostname !== 'youzan.github.io') { + items.forEach((item) => { + if (item.url) { + item.url = + item.url && + item.url.replace('youzan.github.io', location.hostname); + } + }); + } + return items; + }, + }, nav: [ { title: '开发指南', @@ -420,14 +419,13 @@ module.exports = { url: 'https://github.com/youzan/vant', }, ], - // TODO - // searchConfig: { - // apiKey: '90067aecdaa2c85220e2783cd305caac', - // indexName: 'vant', - // searchParameters: { - // facetFilters: ['lang:en-US', 'version:v3'], - // }, - // }, + searchConfig: { + apiKey: '90067aecdaa2c85220e2783cd305caac', + indexName: 'vant', + searchParameters: { + facetFilters: ['lang:en-US', 'version:v3'], + }, + }, nav: [ { title: 'Essentials',