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(client): add markdown content hooks #1620

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

pengzhanbo
Copy link
Member

@pengzhanbo pengzhanbo commented Dec 6, 2024

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
  • Documentation update
  • Other

Description

When the markdown content changes, using the built-in Vue lifecycle hooks does not work well, so the onContentMounted / onContentChange / onContentBeforeUnmount hook has been added to properly listen for changes in the content.

This applies to scenarios such as medium-zoom or photo-swipe that require reinitialization when the page content changes.

@coveralls
Copy link

coveralls commented Dec 6, 2024

Pull Request Test Coverage Report for Build 12308970701

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 71.722%

Totals Coverage Status
Change from base Build 12271244431: 0.0%
Covered Lines: 648
Relevant Lines: 906

💛 - Coveralls

Mister-Hope
Mister-Hope previously approved these changes Dec 6, 2024
@Mister-Hope Mister-Hope requested a review from meteorlxy December 6, 2024 10:32
@Mister-Hope
Copy link
Member

uepress/docs also needs a PR

@pengzhanbo
Copy link
Member Author

uepress/docs also needs a PR

vuepress/docs#44

Copy link
Member

@meteorlxy meteorlxy left a comment

Choose a reason for hiding this comment

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

e2e tests are required

@pengzhanbo pengzhanbo changed the title feat(client): add onContentUpdated hooks feat(client): add markdown content hooks Dec 12, 2024
@pengzhanbo
Copy link
Member Author

@meteorlxy @Mister-Hope
I have rewritten this PR and added relevant e2e tests referencing hmr, but it is not working properly in vite. Can you help me resolve this?

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.

4 participants