Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
计算机应用开发
前端
Vuepress
提交
b0e32093
V
Vuepress
项目概览
计算机应用开发
/
前端
/
Vuepress
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vuepress
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b0e32093
编写于
9月 24, 2018
作者:
U
ULIVZ
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: plugin-search
上级
7b42984f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
84 addition
and
3 deletion
+84
-3
packages/@vuepress/plugin-search/.npmignore
packages/@vuepress/plugin-search/.npmignore
+2
-0
packages/@vuepress/plugin-search/README.md
packages/@vuepress/plugin-search/README.md
+42
-0
packages/@vuepress/plugin-search/SearchBox.vue
packages/@vuepress/plugin-search/SearchBox.vue
+3
-2
packages/@vuepress/plugin-search/index.js
packages/@vuepress/plugin-search/index.js
+11
-0
packages/@vuepress/plugin-search/package.json
packages/@vuepress/plugin-search/package.json
+25
-0
packages/@vuepress/plugin-search/search.svg
packages/@vuepress/plugin-search/search.svg
+0
-0
packages/@vuepress/theme-default/components/Navbar.vue
packages/@vuepress/theme-default/components/Navbar.vue
+1
-1
未找到文件。
packages/@vuepress/plugin-search/.npmignore
0 → 100644
浏览文件 @
b0e32093
__tests__
__mocks__
\ No newline at end of file
packages/@vuepress/plugin-search/README.md
0 → 100644
浏览文件 @
b0e32093
# @vuepress/plugin-search
> header-based search plugin for vuepress
## Usage
1.
Enable this plugin:
```
js
// .vuepress/config.js or themedir/index.js
module
.
exports
=
{
plugins
:
[
[
'
@vuepress/search
'
,
{
searchMaxSuggestions
:
10
}]
],
// Tweak the default color via palette.
palette
:
{
$accentColor
:
'
#b58900
'
,
$textColor
:
'
#586e75
'
,
$borderColor
:
'
#eaecef
'
,
$codeBgColor
:
'
#282c34
'
,
$arrowBgColor
:
'
#ccc
'
}
}
```
2.
Using search component:
```
vue
import SearchBox from '@SearchBox'
```
## Options
### searchMaxSuggestions
-
Type:
`number`
-
Default:
`true`
Set the maximum number of results for search
packages/@vuepress/
theme-default/components
/SearchBox.vue
→
packages/@vuepress/
plugin-search
/SearchBox.vue
浏览文件 @
b0e32093
...
...
@@ -36,6 +36,7 @@
</
template
>
<
script
>
/* global SEARCH_MAX_SUGGESTIONS */
export
default
{
data
()
{
return
{
...
...
@@ -60,8 +61,8 @@ export default {
return
}
const
{
pages
,
themeConfig
}
=
this
.
$site
const
max
=
themeConfig
.
searchMaxSuggestions
||
5
const
{
pages
}
=
this
.
$site
const
max
=
SEARCH_MAX_SUGGESTIONS
const
localePath
=
this
.
$localePath
const
matches
=
item
=>
(
item
.
title
&&
...
...
packages/@vuepress/plugin-search/index.js
0 → 100644
浏览文件 @
b0e32093
const
path
=
require
(
'
path
'
)
module
.
exports
=
(
options
)
=>
({
alias
:
{
'
@SearchBox
'
:
path
.
resolve
(
__dirname
,
'
SearchBox.vue
'
)
},
define
:
{
SEARCH_MAX_SUGGESTIONS
:
options
.
searchMaxSuggestions
||
5
}
})
packages/@vuepress/plugin-search/package.json
0 → 100644
浏览文件 @
b0e32093
{
"name"
:
"@vuepress/plugin-search"
,
"version"
:
"1.0.0"
,
"description"
:
"search plugin for vuepress"
,
"main"
:
"index.js"
,
"publishConfig"
:
{
"access"
:
"public"
},
"repository"
:
{
"type"
:
"git"
,
"url"
:
"git+https://github.com/vuejs/vuepress.git"
},
"keywords"
:
[
"documentation"
,
"vue"
,
"vuepress"
,
"generator"
],
"author"
:
"Evan You"
,
"license"
:
"MIT"
,
"bugs"
:
{
"url"
:
"https://github.com/vuejs/vuepress/issues"
},
"homepage"
:
"https://github.com/vuejs/vuepress/packages/@vuepress/plugin-search#readme"
}
\ No newline at end of file
packages/@vuepress/
theme-default/components
/search.svg
→
packages/@vuepress/
plugin-search
/search.svg
浏览文件 @
b0e32093
文件已移动
packages/@vuepress/theme-default/components/Navbar.vue
浏览文件 @
b0e32093
...
...
@@ -39,7 +39,7 @@
<
script
>
import
SidebarButton
from
'
./SidebarButton.vue
'
import
AlgoliaSearchBox
from
'
@AlgoliaSearchBox
'
import
SearchBox
from
'
./SearchBox.vue
'
import
SearchBox
from
'
@SearchBox
'
import
NavLinks
from
'
./NavLinks.vue
'
export
default
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录