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

feat(theme-default): improve sidebar headers #196

Merged
merged 5 commits into from
Jun 5, 2024

Conversation

pengzhanbo
Copy link
Member

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Provide a description in this PR that addresses what the PR is solving. If this PR is going to solve an existing issue, please reference the issue (e.g. close #123).

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other

Description

@coveralls
Copy link

coveralls commented Jun 4, 2024

Pull Request Test Coverage Report for Build 9380781281

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 56.168%

Totals Coverage Status
Change from base Build 9379255829: 0.0%
Covered Lines: 992
Relevant Lines: 1582

💛 - Coveralls


defineSlots<{
'top'?: (props: Record<never, never>) => any
'bottom'?: (props: Record<never, never>) => any
'content-top'?: (props: Record<never, never>) => any
'content-bottom'?: (props: Record<never, never>) => any
}>()

setupHeaders()
Copy link
Member

Choose a reason for hiding this comment

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

Why not place it in sidebar

Copy link
Member Author

@pengzhanbo pengzhanbo Jun 5, 2024

Choose a reason for hiding this comment

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

The new headers need to wait for the <Content /> component to be Mounted before being read from the DOM. The <VPPage /> component can ensure that the DOM is Mounted, but placing it in the <Sidebar /> cannot guarantee this. Additionally, reading and generating new content to be inserted into the DOM after being Mounted may trigger onMounted again, causing unnecessary repeated calls and potentially leading to new issues.

@Mister-Hope Mister-Hope merged commit c39e4e4 into main Jun 5, 2024
32 checks passed
@Mister-Hope Mister-Hope deleted the theme-default-headers branch June 5, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants