Skip to content

Commit 1782169

Browse files
committed
增加搜索
1 parent efb8337 commit 1782169

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

package-lock.json

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"devDependencies": {
1414
"@vuepress/bundler-vite": "2.0.0-rc.19",
15+
"@vuepress/plugin-slimsearch": "^2.0.0-rc.67",
1516
"sass-embedded": "^1.83.0",
1617
"vue": "^3.5.13",
1718
"vuepress": "2.0.0-rc.19",

src/.vuepress/theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export default hopeTheme({
130130
components: {
131131
components: ["Badge", "VPCard"],
132132
},
133+
slimsearch: true,
133134

134135
// 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释
135136
// pwa: {

src/guide/install/thinkphp.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,29 @@ composer require hg/apidoc
4848

4949
打开浏览器访问 http://你的域名/apidoc/ ,出现接口文档页面,表示安装成功。
5050

51+
::: warning 404 问题
52+
如果使用 `php think run` 命令行启动项目,apidoc 可能会出现 404 错误,这是因为命令行启动的项目并未对 apidoc 接口进行伪静态处理,解决方案:
53+
54+
1、前端配置 host
55+
56+
```php
57+
// public/apidoc/config.js
58+
var config = {
59+
// 请求地址host
60+
HTTP:{
61+
HOSTS: [
62+
{
63+
title:"",
64+
host:"/index.php"
65+
}
66+
]
67+
}
68+
};
69+
```
70+
71+
2、在集成环境中运行,并正确配置伪静态
72+
:::
73+
5174
## TP5.1 配置
5275

5376
1、TP5.1 版本需手动配置,让 Apidoc 在应用初始化时注册相关服务,如下:

0 commit comments

Comments
 (0)