mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-09-05 23:49:53 +08:00
docs: 支持点击放大文档中的图片 (#149)
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
.medium-zoom-overlay {
|
||||||
|
z-index: 30;
|
||||||
|
}
|
||||||
|
|
||||||
|
.medium-zoom-image--opened {
|
||||||
|
z-index: 31;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import DefaultTheme from "vitepress/theme";
|
||||||
|
import { onMounted, watch, nextTick } from "vue";
|
||||||
|
import { useRoute } from "vitepress";
|
||||||
|
import mediumZoom from "medium-zoom";
|
||||||
|
import "./index.css";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
...DefaultTheme,
|
||||||
|
setup() {
|
||||||
|
const route = useRoute();
|
||||||
|
const initZoom = () => {
|
||||||
|
mediumZoom(".main img", { background: "var(--vp-c-bg)" });
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
initZoom();
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => route.path,
|
||||||
|
() => nextTick(() => initZoom()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
Binary file not shown.
@@ -2,6 +2,7 @@
|
|||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"markdown-it-task-lists": "^2.1.1",
|
"markdown-it-task-lists": "^2.1.1",
|
||||||
|
"medium-zoom": "^1.1.0",
|
||||||
"vitepress": "^1.2.3"
|
"vitepress": "^1.2.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user