Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
garygan89 opened this issue Jun 9, 2024 · 0 comments
Open

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

garygan89 opened this issue Jun 9, 2024 · 0 comments

Comments

@garygan89
Copy link

garygan89 commented Jun 9, 2024

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);
    }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant