diff --git a/src/components/Sticky/index.vue b/src/components/Sticky/index.vue index 5624a989..fa165bc7 100644 --- a/src/components/Sticky/index.vue +++ b/src/components/Sticky/index.vue @@ -1,6 +1,9 @@ <template> <div :style="{height:height+'px',zIndex:zIndex}"> - <div :class="className" :style="{top:stickyTop+'px',zIndex:zIndex,position:position,width:width,height:height+'px'}"> + <div + :class="className" + :style="{top:(isSticky ? stickyTop +'px' : ''),zIndex:zIndex,position:position,width:width,height:height+'px'}" + > <slot> <div>sticky</div> </slot>