Update bar.vue

This commit is contained in:
波比小金刚 2021-07-02 16:49:55 +08:00 committed by Herrington Darkholme
parent 721a3d2743
commit 4202e176c6

View File

@ -52,7 +52,7 @@ export default defineComponent({
}
const clickTrackHandler = (e: MouseEvent) => {
const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client])
const offset = Math.abs((e.target as HTMLElement).getBoundingClientRect()[bar.value.direction] - e[bar.value.client])
const thumbHalf = (thumb.value[bar.value.offset] / 2)
const thumbPositionPercentage = ((offset - thumbHalf) * 100 / instance.value[bar.value.offset])