@@ -131,7 +131,12 @@ const Affix = {
131
131
measure ( ) {
132
132
const { status, lastAffix } = this ;
133
133
const { target } = this ;
134
- if ( status !== AffixStatus . Prepare || ! this . $refs . fixedNode || ! this . $el || ! target ) {
134
+ if (
135
+ status !== AffixStatus . Prepare ||
136
+ ! this . $refs . fixedNode ||
137
+ ! this . $refs . placeholderNode ||
138
+ ! target
139
+ ) {
135
140
return ;
136
141
}
137
142
@@ -147,7 +152,7 @@ const Affix = {
147
152
status : AffixStatus . None ,
148
153
} ;
149
154
const targetRect = getTargetRect ( targetNode ) ;
150
- const placeholderReact = getTargetRect ( this . $el ) ;
155
+ const placeholderReact = getTargetRect ( this . $refs . placeholderNode ) ;
151
156
const fixedTop = getFixedTop ( placeholderReact , targetRect , offsetTop ) ;
152
157
const fixedBottom = getFixedBottom ( placeholderReact , targetRect , offsetBottom ) ;
153
158
if ( fixedTop !== undefined ) {
@@ -209,9 +214,9 @@ const Affix = {
209
214
const offsetBottom = this . getOffsetBottom ( ) ;
210
215
211
216
const targetNode = target ( ) ;
212
- if ( targetNode && this . $el ) {
217
+ if ( targetNode && this . $refs . placeholderNode ) {
213
218
const targetRect = getTargetRect ( targetNode ) ;
214
- const placeholderReact = getTargetRect ( this . $el ) ;
219
+ const placeholderReact = getTargetRect ( this . $refs . placeholderNode ) ;
215
220
const fixedTop = getFixedTop ( placeholderReact , targetRect , offsetTop ) ;
216
221
const fixedBottom = getFixedBottom ( placeholderReact , targetRect , offsetBottom ) ;
217
222
@@ -234,7 +239,6 @@ const Affix = {
234
239
const className = classNames ( {
235
240
[ getPrefixCls ( 'affix' , prefixCls ) ] : affixStyle ,
236
241
} ) ;
237
-
238
242
const props = omit ( $props , [ 'prefixCls' , 'offsetTop' , 'offsetBottom' , 'target' ] ) ;
239
243
return (
240
244
< ResizeObserver
0 commit comments