File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
plugins/features/plugin-medium-zoom/src/client Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type { ZoomOptions } from 'medium-zoom'
2
2
import mediumZoom from 'medium-zoom'
3
3
import { defineClientConfig , onContentUpdated } from 'vuepress/client'
4
- import { mediumZoomSymbol } from './composables/index.js'
4
+ import { mediumZoomSymbol , useMediumZoom } from './composables/index.js'
5
5
6
6
import './styles/vars.css'
7
7
import './styles/medium-zoom.css'
@@ -23,9 +23,13 @@ export default defineClientConfig({
23
23
zoom . attach ( sel )
24
24
}
25
25
app . provide ( mediumZoomSymbol , zoom )
26
+ } ,
27
+
28
+ setup ( ) {
29
+ const zoom = useMediumZoom ( )
26
30
27
31
onContentUpdated ( ( reason ) => {
28
- if ( reason !== 'beforeUnmount' ) zoom . refresh ( )
32
+ if ( reason !== 'beforeUnmount' ) zoom ! . refresh ( )
29
33
} )
30
34
} ,
31
35
} )
You can’t perform that action at this time.
0 commit comments