|
@@ -2,7 +2,7 @@ import { onMounted, onUnmounted, ref, watchEffect } from "vue";
|
|
|
|
|
|
export function dragSplitPane() {
|
|
export function dragSplitPane() {
|
|
let pos = { y: 0 };
|
|
let pos = { y: 0 };
|
|
- const dragSpliter = ref((null as unknown) as HTMLDivElement);
|
|
|
|
|
|
+ const dragSpliter = ref(null as unknown as HTMLDivElement);
|
|
let topPercent = ref(30);
|
|
let topPercent = ref(30);
|
|
|
|
|
|
const mouseDownHandler = function (e: MouseEvent) {
|
|
const mouseDownHandler = function (e: MouseEvent) {
|
|
@@ -63,8 +63,7 @@ export function dragSplitPane() {
|
|
// TODO: 暂时不知道为啥有 140
|
|
// TODO: 暂时不知道为啥有 140
|
|
if (parent)
|
|
if (parent)
|
|
topPercent.value =
|
|
topPercent.value =
|
|
- (100 * (target.offsetTop - 140)) /
|
|
|
|
- parseFloat(getComputedStyle(parent).height);
|
|
|
|
|
|
+ (100 * target.offsetTop) / parseFloat(getComputedStyle(parent).height);
|
|
// console.log({
|
|
// console.log({
|
|
// topPercent: topPercent.value,
|
|
// topPercent: topPercent.value,
|
|
// "parseFloat(getComputedStyle(parent).height)": parseFloat(
|
|
// "parseFloat(getComputedStyle(parent).height)": parseFloat(
|