feat(client): add onContentUpdated composition API#1620
feat(client): add onContentUpdated composition API#1620meteorlxy merged 24 commits intovuepress:mainfrom
Conversation
Pull Request Test Coverage Report for Build 13484345740Details
💛 - Coveralls |
|
uepress/docs also needs a PR |
|
onContentUpdated hooks|
@meteorlxy @Mister-Hope |
|
I think the Vite behavior is expeceted. Vite use cache header to let browser caches imported modules natively, and when you triggered a HMR, the page is reloaded with the updated module appended with a query In another word, The same behavior is observed with Vite Typescript template: https://stackblitz.com/edit/vitejs-vite-q2vxvna7?file=src%2Fcounter.ts&terminal=dev (tested locally as stackblitz perform hotload while editing), where HMR is triggered when modifying counter.ts |
Before submitting the PR, please make sure you do the following
close #123).What is the purpose of this pull request?
Description
When the markdown content changes, using the built-in Vue lifecycle hooks does not work well, so the
onContentUpdatedhook has been added to properly listen for changes in the content.This applies to scenarios such as
medium-zoomorphoto-swipethat require reinitialization when the page content changes.