@vuepress/plugin-docsearch
Advanced tools
Comparing version 2.0.0-beta.47 to 2.0.0-beta.48
@@ -17,29 +17,27 @@ import { useSiteData } from '@vuepress/client'; | ||
return { | ||
// transform full url to route path | ||
transformItems: (items) => items.map((item) => ({ | ||
...item, | ||
// the `item.url` is full url with protocol and hostname | ||
// render the hit component with custom `onClick` handler | ||
hitComponent: ({ hit, children }) => { | ||
// the `hit.url` is full url with protocol and hostname | ||
// so we have to transform it to vue-router path | ||
url: resolveRoutePathFromUrl(item.url, site.value.base), | ||
})), | ||
// render the hit component with custom `onClick` handler | ||
hitComponent: ({ hit, children }) => ({ | ||
type: 'a', | ||
ref: undefined, | ||
constructor: undefined, | ||
key: undefined, | ||
props: { | ||
href: hit.url, | ||
// handle `onClick` by `router.push` | ||
onClick: (event) => { | ||
if (isSpecialClick(event)) { | ||
return; | ||
} | ||
event.preventDefault(); | ||
router.push(hit.url); | ||
const routePath = resolveRoutePathFromUrl(hit.url, site.value.base); | ||
return { | ||
type: 'a', | ||
ref: undefined, | ||
constructor: undefined, | ||
key: undefined, | ||
props: { | ||
href: hit.url, | ||
// handle `onClick` by `router.push` | ||
onClick: (event) => { | ||
if (isSpecialClick(event)) { | ||
return; | ||
} | ||
event.preventDefault(); | ||
router.push(routePath); | ||
}, | ||
children, | ||
}, | ||
children, | ||
}, | ||
__v: null, | ||
}), | ||
__v: null, | ||
}; | ||
}, | ||
// navigation behavior triggered by `onKeyDown` internally | ||
@@ -46,0 +44,0 @@ navigator: { |
{ | ||
"name": "@vuepress/plugin-docsearch", | ||
"version": "2.0.0-beta.47", | ||
"version": "2.0.0-beta.48", | ||
"description": "VuePress plugin - docsearch", | ||
@@ -32,6 +32,6 @@ "keywords": [ | ||
"@docsearch/react": "^3.1.0", | ||
"@vuepress/client": "2.0.0-beta.47", | ||
"@vuepress/core": "2.0.0-beta.47", | ||
"@vuepress/shared": "2.0.0-beta.47", | ||
"@vuepress/utils": "2.0.0-beta.47", | ||
"@vuepress/client": "2.0.0-beta.48", | ||
"@vuepress/core": "2.0.0-beta.48", | ||
"@vuepress/shared": "2.0.0-beta.48", | ||
"@vuepress/utils": "2.0.0-beta.48", | ||
"ts-debounce": "^4.0.0", | ||
@@ -38,0 +38,0 @@ "vue": "^3.2.36", |
12619
264
+ Added@vuepress/client@2.0.0-beta.48(transitive)
+ Added@vuepress/core@2.0.0-beta.48(transitive)
+ Added@vuepress/markdown@2.0.0-beta.48(transitive)
+ Added@vuepress/shared@2.0.0-beta.48(transitive)
+ Added@vuepress/utils@2.0.0-beta.48(transitive)
- Removed@vuepress/client@2.0.0-beta.47(transitive)
- Removed@vuepress/core@2.0.0-beta.47(transitive)
- Removed@vuepress/markdown@2.0.0-beta.47(transitive)
- Removed@vuepress/shared@2.0.0-beta.47(transitive)
- Removed@vuepress/utils@2.0.0-beta.47(transitive)
Updated@vuepress/core@2.0.0-beta.48