Skip to content
New issue

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

fix($core): Search result cannot jump to the correct hash anchor (close: #1594) #1599

Merged
merged 1 commit into from
May 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/@vuepress/core/lib/client/components/Content.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { getPageAsyncComponent } from '../util'

export default {
props: {
Expand All @@ -10,9 +9,8 @@ export default {
},
render (h) {
const pageKey = this.pageKey || this.$parent.$page.key
const pageComponent = getPageAsyncComponent(pageKey)
Copy link
Member Author

@ulivz ulivz May 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component has been registered in beforeEnter hook of vue-router, so there's no need to look it up again, but strangely, the two writings lead to different rendering times for the component. (Refer to the contrastive snapshots in the text.)

if (pageComponent) {
return h(pageComponent)
if (pageKey) {
return h(pageKey)
}
return h('')
}
Expand Down