fix: affix $refs.placeholderNode cannot get
parent
8b4c55c75f
commit
424c880fbf
|
@ -131,12 +131,7 @@ const Affix = {
|
||||||
measure() {
|
measure() {
|
||||||
const { status, lastAffix } = this;
|
const { status, lastAffix } = this;
|
||||||
const { target } = this;
|
const { target } = this;
|
||||||
if (
|
if (status !== AffixStatus.Prepare || !this.$refs.fixedNode || !this.$el || !target) {
|
||||||
status !== AffixStatus.Prepare ||
|
|
||||||
!this.$refs.fixedNode ||
|
|
||||||
!this.$refs.placeholderNode ||
|
|
||||||
!target
|
|
||||||
) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +147,7 @@ const Affix = {
|
||||||
status: AffixStatus.None,
|
status: AffixStatus.None,
|
||||||
};
|
};
|
||||||
const targetRect = getTargetRect(targetNode);
|
const targetRect = getTargetRect(targetNode);
|
||||||
const placeholderReact = getTargetRect(this.$refs.placeholderNode);
|
const placeholderReact = getTargetRect(this.$el);
|
||||||
const fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop);
|
const fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop);
|
||||||
const fixedBottom = getFixedBottom(placeholderReact, targetRect, offsetBottom);
|
const fixedBottom = getFixedBottom(placeholderReact, targetRect, offsetBottom);
|
||||||
if (fixedTop !== undefined) {
|
if (fixedTop !== undefined) {
|
||||||
|
@ -214,9 +209,9 @@ const Affix = {
|
||||||
const offsetBottom = this.getOffsetBottom();
|
const offsetBottom = this.getOffsetBottom();
|
||||||
|
|
||||||
const targetNode = target();
|
const targetNode = target();
|
||||||
if (targetNode && this.$refs.placeholderNode) {
|
if (targetNode && this.$el) {
|
||||||
const targetRect = getTargetRect(targetNode);
|
const targetRect = getTargetRect(targetNode);
|
||||||
const placeholderReact = getTargetRect(this.$refs.placeholderNode);
|
const placeholderReact = getTargetRect(this.$el);
|
||||||
const fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop);
|
const fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop);
|
||||||
const fixedBottom = getFixedBottom(placeholderReact, targetRect, offsetBottom);
|
const fixedBottom = getFixedBottom(placeholderReact, targetRect, offsetBottom);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue