|
@@ -31,8 +31,8 @@ const imagesHtml = ref("");
|
|
|
|
|
|
onBeforeUpdate(() => {
|
|
|
imagesHtml.value =
|
|
|
- document.querySelector(".mark-body-container")?.innerHTML ??
|
|
|
- "请关闭或重新打开";
|
|
|
+ document.querySelector(".mark-body-container div:first-of-type")
|
|
|
+ ?.innerHTML ?? "请关闭或重新打开";
|
|
|
// 没取到图片,提示
|
|
|
// if (imagesHtml.value.length <= 500) {
|
|
|
// imagesHtml.value = "请关闭或重新打开";
|
|
@@ -42,7 +42,6 @@ onBeforeUpdate(() => {
|
|
|
});
|
|
|
|
|
|
const setScrollTo = (e: MouseEvent) => {
|
|
|
- // console.log(e);
|
|
|
const target = e.target as HTMLElement;
|
|
|
const container = target.parentElement?.parentElement as HTMLDivElement;
|
|
|
const containerPos = container.getBoundingClientRect();
|
|
@@ -50,11 +49,15 @@ const setScrollTo = (e: MouseEvent) => {
|
|
|
const parentPos = parent.getBoundingClientRect();
|
|
|
// console.log(containerPos, parentPos);
|
|
|
// 试验出来的... 大概就是2个顶部距离相减,得到相对距离
|
|
|
- const scrollTo =
|
|
|
+ const scrollToX =
|
|
|
+ (e.offsetX + parentPos.x - containerPos.x) /
|
|
|
+ parseFloat(getComputedStyle(container).width);
|
|
|
+ const scrollToY =
|
|
|
(e.offsetY + parentPos.y - containerPos.y) /
|
|
|
parseFloat(getComputedStyle(container).height);
|
|
|
- if (typeof scrollTo === "number") {
|
|
|
- store.minimapScrollTo = scrollTo;
|
|
|
+ if (typeof scrollToX === "number" && typeof scrollToY === "number") {
|
|
|
+ store.minimapScrollToX = scrollToX;
|
|
|
+ store.minimapScrollToY = scrollToY;
|
|
|
}
|
|
|
};
|
|
|
const close = () => {
|