mirror of
https://github.com/element-plus/element-plus.git
synced 2025-04-06 16:30:35 +08:00
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:
parent
bd95cc8a46
commit
6b7e204e5b
@ -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
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user