vitepress-theme-default-plus icon indicating copy to clipboard operation
vitepress-theme-default-plus copied to clipboard

Image not showing if using vitepress-plugin-image-viewer

Open garygan89 opened this issue 8 months ago • 0 comments

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.

image

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);
    }
};

garygan89 avatar Jun 09 '24 18:06 garygan89