mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
fix(IndexBar): incorrect anchor position when anchor doesn't have a parent node (#5429)
This commit is contained in:
@@ -14,8 +14,9 @@ export default createComponent({
|
||||
data() {
|
||||
return {
|
||||
top: 0,
|
||||
active: false,
|
||||
position: 'static'
|
||||
left: null,
|
||||
width: null,
|
||||
active: false
|
||||
};
|
||||
},
|
||||
|
||||
@@ -27,10 +28,11 @@ export default createComponent({
|
||||
anchorStyle() {
|
||||
if (this.sticky) {
|
||||
return {
|
||||
position: this.position,
|
||||
zIndex: `${this.parent.zIndex}`,
|
||||
left: this.left ? `${this.left}px` : null,
|
||||
width: this.width ? `${this.width}px` : null,
|
||||
transform: `translate3d(0, ${this.top}px, 0)`,
|
||||
color: this.parent.highlightColor,
|
||||
color: this.parent.highlightColor
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user