Open RayShineHub opened 2 years ago
In fact, I want you to keep mouse click events, such as V2's handleselect(),which can customize the jump logic of the page
How do I need to configure to jump to the local station?
The extracted element (in the Crawler config) needs to be related or close enough (parent, sibling, children) to the anchor: e.g. here the vuepress-v3-template
anchor is a children of h2
, which is the element we index.
hello @shortcuts
Searching in an article can realize the jump of the anchor point in the page, but when you click from the home page to the anchor point of searching an article, the website will be reloaded, which will cause some global components to be reloaded.
Can you use handleselect()
to intercept the click event and jump the page through the Router
, as in docSearch V2
?
like this:
handleSelected: (input, event, suggestion) => {
const { pathname, hash } = new URL(suggestion.url)
instance.$router.push(`${pathname}${hash}`)
}
How do I need to configure to jump to the local station?
The extracted element (in the Crawler config) needs to be related or close enough (parent, sibling, children) to the anchor: e.g. here the
vuepress-v3-template
anchor is a children ofh2
, which is the element we index.
but when you click from the home page to the anchor point of searching an article, the website will be reloaded, which will cause some global components to be reloaded.
Ah yes it make sense, but there is indeed no click handler exposed on DocSearch v3. As a workaround, you can import the DocSearch
component and add you own logic here
Ah yes it make sense, but there is indeed no click handler exposed on DocSearch v3. As a workaround, you can import the
DocSearch
component and add you own logic here
Ah, but my website is based on Vue
. If the import component changes a lot, I hope DocSearch V3
can expose click handler exposed. Like V2
, I believe it is beneficial to many players!
What do you think?
hello @shortcuts
Can you write an example of a custom hitcomponent
component based on vue 3
How do I need to configure to jump to the local station?
At present, my link is like this
It always refreshes the page again
But I want to be like your document, like this