fix(components): [dialog] rename resetPostion to resetPosition (#17900)

* fix(components): [dialog] rename resetPostion to resetPosition

* chore: fix lint

* chore: reset CHANGELOG.en-US.md

---------

Co-authored-by: tolking <qw13131wang@gmail.com>
This commit is contained in:
于智勇 2024-08-21 22:34:12 +08:00 committed by GitHub
parent bd95cc8a46
commit 6b7e204e5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 10 deletions

View File

@ -171,9 +171,9 @@ When using `modal` = false, please make sure that `append-to-body` was set to **
### Exposes
| Name | Description | Type |
| --------------------- | ------------- | ----------------------- |
| resetPostion ^(2.8.0) | reset postion | ^[Function]`() => void` |
| Name | Description | Type |
| ---------------------- | -------------- | ----------------------- |
| resetPosition ^(2.8.1) | reset position | ^[Function]`() => void` |
## FAQ

View File

@ -61,8 +61,14 @@ const composedDialogRef = composeRefs(focusTrapRef, dialogRef)
const draggable = computed(() => props.draggable)
const overflow = computed(() => props.overflow)
const { resetPostion } = useDraggable(dialogRef, headerRef, draggable, overflow)
const { resetPosition } = useDraggable(
dialogRef,
headerRef,
draggable,
overflow
)
defineExpose({
resetPostion,
resetPosition,
})
</script>

View File

@ -142,14 +142,14 @@ const overlayEvent = useSameTarget(onModalClick)
const draggable = computed(() => props.draggable && !props.fullscreen)
const resetPostion = () => {
dialogContentRef.value?.resetPostion()
const resetPosition = () => {
dialogContentRef.value?.resetPosition()
}
defineExpose({
/** @description whether the dialog is visible */
visible,
dialogContentRef,
resetPostion,
resetPosition,
})
</script>

View File

@ -74,7 +74,7 @@ export const useDraggable = (
}
}
const resetPostion = () => {
const resetPosition = () => {
transform = {
offsetX: 0,
offsetY: 0,
@ -99,6 +99,6 @@ export const useDraggable = (
})
return {
resetPostion,
resetPosition,
}
}