vitepress-theme-default-plus
vitepress-theme-default-plus copied to clipboard
Image not showing if using vitepress-plugin-image-viewer
When installing https://github.com/T-miracle/vitepress-plugin-image-viewer, it only shows the image toolbar, but not the image. And clicking the x
button on the top right didn't quit the toolbox overlay.
My .vitepress/theme/index.js
import VPLTheme from '@lando/vitepress-theme-default-plus';
import './custom.css'
import 'viewerjs/dist/viewer.min.css';
import imageViewer from 'vitepress-plugin-image-viewer';
import vImageViewer from 'vitepress-plugin-image-viewer/lib/vImageViewer.vue';
import { useRoute } from 'vitepress';
export default {
...VPLTheme,
enhanceApp(ctx) {
VPLTheme.enhanceApp(ctx);
ctx.app.component('vImageViewer', vImageViewer);
},
setup() {
// Get route
const route = useRoute();
// Using
imageViewer(route);
}
};