Open prashantnirgun opened 2 years ago
Check this issue and comment, that might be help
If you create your own vitepress theme, you can integrate medium-zoom
as follows:
import type { Theme } from 'vitepress'
import { inBrowser, useRoute } from 'vitepress'
import mediumZoom from 'medium-zoom'
import { nextTick, watch } from 'vue'
import Layout from './Layout.vue'
import NotFound from './NotFound.vue'
export default <Theme>{
Layout,
NotFound,
setup() {
const route = useRoute()
watch(
() => route.path,
() => nextTick(() => {
if (inBrowser)
mediumZoom('[data-zoomable]')
}),
{ immediate: true },
)
},
}
Add data-zoomable
data attribute in markdown:
![alt](src){data-zoomable}
I started migrating from vuepress to vitepress then I realize I been using this zoom plugin. its been important for me. Is there any way out where I can use this plugin inside vitepress markdown file ?
If anyone knows any article or solution please share