mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 04:37:47 +08:00
feat: add event type definition
This commit is contained in:
parent
e6c38e6d6f
commit
721a3d2743
@ -51,7 +51,7 @@ export default defineComponent({
|
||||
barStore.value[bar.value.axis] = (e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]))
|
||||
}
|
||||
|
||||
const clickTrackHandler = e => {
|
||||
const clickTrackHandler = (e: MouseEvent) => {
|
||||
const offset = Math.abs(e.target.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])
|
||||
@ -59,7 +59,7 @@ export default defineComponent({
|
||||
wrap.value[bar.value.scroll] = (thumbPositionPercentage * wrap.value[bar.value.scrollSize] / 100)
|
||||
}
|
||||
|
||||
const startDrag = e => {
|
||||
const startDrag = (e: MouseEvent) => {
|
||||
e.stopImmediatePropagation()
|
||||
cursorDown.value = true
|
||||
on(document, 'mousemove', mouseMoveDocumentHandler)
|
||||
@ -68,7 +68,7 @@ export default defineComponent({
|
||||
document.onselectstart = () => false
|
||||
}
|
||||
|
||||
const mouseMoveDocumentHandler = e => {
|
||||
const mouseMoveDocumentHandler = (e: MouseEvent) => {
|
||||
if (cursorDown.value === false) return
|
||||
const prevPage = barStore.value[bar.value.axis]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user