mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
1.4 KiB
1.4 KiB
title, icon, createTime, permalink
| title | icon | createTime | permalink |
|---|---|---|---|
| 图片预览 | ri:image-line | 2025/07/03 20:46:17 | /guide/features/image-preview/ |
在主题中,图片默认支持点击后放大预览。通过查找 文档内容中的图片,形成图片预览列表。
该功能由 @vuepress/plugin-photo-swipe 插件提供支持。
配置
图片预览默认启用,也可以通过以下配置修改行为:
export default defineUserConfig({
theme: plumeTheme({
plugins: {
photoSwipe: {
// 图片选择器
selector: '.vp-doc :not(a) > img:not([no-view],.no-view,.ignore)',
download: true, // 是否显示下载按钮
fullscreen: true, // 是否显示全屏按钮
scrollToClose: true, // 是否在滚动时关闭当前图片
}
}
})
})
更多配置请参考 @vuepress/plugin-photo-swipe
忽略图片预览
可以通过 no-view 或 ignore 类名,或者 no-view 属性来忽略图片预览。
{.no-view}
{.ignore}
{no-view}
<img src="path/to/image" class="no-view" alt="alt text">
<img src="path/to/image" class="ignore" alt="alt text">
<img src="path/to/image" no-view alt="alt text">