mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-12 10:45:10 +08:00
fix(affix): change target.value to props.target in judgement (#1343)
This commit is contained in:
parent
59422d7fab
commit
d58f480aa3
@ -80,7 +80,7 @@ export default defineComponent({
|
||||
state.clientHeight = document.documentElement.clientHeight
|
||||
|
||||
if (props.position === 'top') {
|
||||
if (target.value) {
|
||||
if (props.target) {
|
||||
const difference = targetRect.bottom - props.offset - state.height
|
||||
state.fixed = props.offset > rootRect.top && targetRect.bottom > 0
|
||||
state.transform = difference < 0 ? difference : 0
|
||||
@ -88,7 +88,7 @@ export default defineComponent({
|
||||
state.fixed = props.offset > rootRect.top
|
||||
}
|
||||
} else {
|
||||
if (target.value) {
|
||||
if (props.target) {
|
||||
const difference = state.clientHeight - targetRect.top - props.offset - state.height
|
||||
state.fixed = state.clientHeight - props.offset < rootRect.bottom && state.clientHeight > targetRect.top
|
||||
state.transform = difference < 0 ? -difference : 0
|
||||
|
Loading…
Reference in New Issue
Block a user