Skip to content

Commit 7b753df

Browse files
committed
fix(plugin-medium-zoom): fix onContentUpdate usage
1 parent ff43cef commit 7b753df

File tree

1 file changed

+6
-2
lines changed
  • plugins/features/plugin-medium-zoom/src/client

1 file changed

+6
-2
lines changed

Diff for: plugins/features/plugin-medium-zoom/src/client/config.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ZoomOptions } from 'medium-zoom'
22
import mediumZoom from 'medium-zoom'
33
import { defineClientConfig, onContentUpdated } from 'vuepress/client'
4-
import { mediumZoomSymbol } from './composables/index.js'
4+
import { mediumZoomSymbol, useMediumZoom } from './composables/index.js'
55

66
import './styles/vars.css'
77
import './styles/medium-zoom.css'
@@ -23,9 +23,13 @@ export default defineClientConfig({
2323
zoom.attach(sel)
2424
}
2525
app.provide(mediumZoomSymbol, zoom)
26+
},
27+
28+
setup() {
29+
const zoom = useMediumZoom()
2630

2731
onContentUpdated((reason) => {
28-
if (reason !== 'beforeUnmount') zoom.refresh()
32+
if (reason !== 'beforeUnmount') zoom!.refresh()
2933
})
3034
},
3135
})

0 commit comments

Comments
 (0)