We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff43cef commit 7b753dfCopy full SHA for 7b753df
plugins/features/plugin-medium-zoom/src/client/config.ts
@@ -1,7 +1,7 @@
1
import type { ZoomOptions } from 'medium-zoom'
2
import mediumZoom from 'medium-zoom'
3
import { defineClientConfig, onContentUpdated } from 'vuepress/client'
4
-import { mediumZoomSymbol } from './composables/index.js'
+import { mediumZoomSymbol, useMediumZoom } from './composables/index.js'
5
6
import './styles/vars.css'
7
import './styles/medium-zoom.css'
@@ -23,9 +23,13 @@ export default defineClientConfig({
23
zoom.attach(sel)
24
}
25
app.provide(mediumZoomSymbol, zoom)
26
+ },
27
+
28
+ setup() {
29
+ const zoom = useMediumZoom()
30
31
onContentUpdated((reason) => {
- if (reason !== 'beforeUnmount') zoom.refresh()
32
+ if (reason !== 'beforeUnmount') zoom!.refresh()
33
})
34
},
35
0 commit comments