We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
文档搜索功能点击搜索结果会跳转到有赞的文档.
相关内容
估计需要申请 algolia 账号以及提 pr 到 docsearch-configs
The text was updated successfully, but these errors were encountered:
搜索结果中的一项是一个跳转到 https://youzan.github.io/vant a 链接
https://youzan.github.io/vant
vant 的文档实例化了一个docsearch 对象,搜索结果的 UI 是通过 docsearch 这个实例对象创建出来的。
docsearch
mounted() { if (this.searchConfig) { this.docsearchInstance = window.docsearch({ ...this.searchConfig, inputSelector: '.van-doc-search', algoliaOptions: { facetFilters: [`lang:${this.lang}`] } }); } }
SearchInput
而element-ui 的文档的搜索结果是用自己的 autocomplete 组件显示的,点击搜索结果执行 handleSelect 方法
autocomplete
handleSelect
这个方法直接跳转网站内路由,所以不会跳转到 element 官方的文档网站去
向 Docsearch 申请一个 apiKey
apiKey
使用申请到的 key 替换原来的
export const searchConfig = { apiKey: '90067aecdaa2c85220e2783cd305caac', indexName: 'vant' };
使用 docssearch 提供的搜索结果 ui dropdown
像 element-ui 那样自己开发一个结果展示的 UI
Sorry, something went wrong.
No branches or pull requests
文档搜索功能点击搜索结果会跳转到有赞的文档.
相关内容
估计需要申请 algolia 账号以及提 pr 到 docsearch-configs
The text was updated successfully, but these errors were encountered: