File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<template>
2- <view wx:ref class="cube-sticky" wx:style="{{containerStyle }}">
2+ <view wx:ref class="cube-sticky" wx:style="{{styleConfig.sticky }}">
33 <slot></slot>
4- <view class="cube-sticky-fixed" wx:style="{{fixedEleStyle}}" wx:ref="fixedEle">
4+ <view class="cube-sticky-fixed" wx:style="{{[ fixedEleStyle, styleConfig.fixedEle] }}" wx:ref="fixedEle">
55 </view>
66 </view>
77</template>
Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ createComponent({
3737 // 重置高度为 auto,然后重新计算并设置固定高度
3838 this . eleHeight = 'auto' ;
3939 const query = this . createSelectorQuery ( ) ;
40- // eslint-disable-next-line
41- // @ts -ignore
40+ // eslint-disable-next-line @typescript-eslint/no-this-alias
4241 const that = this ;
4342 query . select ( '.cube-sticky-ele' ) . boundingClientRect ( ( rect ) => {
4443 if ( rect && rect . height > 0 ) {
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ createComponent({
2020 offset : {
2121 type : Number ,
2222 value : 0
23+ } ,
24+ styleConfig : {
25+ type : Object ,
26+ value : { }
2327 }
2428 } ,
2529 data : {
@@ -33,9 +37,6 @@ createComponent({
3337 eles : [ ]
3438 } ,
3539 computed : {
36- containerStyle ( ) {
37- return { } ;
38- } ,
3940 fixedEleStyle ( ) {
4041 return {
4142 top : `${ this . offset } px`
Original file line number Diff line number Diff line change 11<template>
2- <view wx:ref class="cube-sticky" wx:style="{{containerStyle }}">
2+ <view wx:ref class="cube-sticky" wx:style="{{styleConfig.sticky }}">
33 <slot></slot>
4- <view class="cube-sticky-fixed" wx:style="{{fixedEleStyle}}" wx:ref="fixedEle">
4+ <view class="cube-sticky-fixed" wx:style="{{[ fixedEleStyle, styleConfig.fixedEle] }}" wx:ref="fixedEle">
55 </view>
66 </view>
77</template>
Original file line number Diff line number Diff line change @@ -38,8 +38,7 @@ createComponent({
3838 // 重置高度为 auto,然后重新计算并设置固定高度
3939 this . eleHeight = 'auto'
4040 const query = this . createSelectorQuery ( )
41- // eslint-disable-next-line
42- // @ts -ignore
41+ // eslint-disable-next-line @typescript-eslint/no-this-alias
4342 const that = this
4443 query . select ( '.cube-sticky-ele' ) . boundingClientRect ( ( rect : any ) => {
4544 if ( rect && rect . height > 0 ) {
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ createComponent({
3131 offset : {
3232 type : Number ,
3333 value : 0
34+ } ,
35+ styleConfig : {
36+ type : Object ,
37+ value : { }
3438 }
3539 } ,
3640 data : {
@@ -44,9 +48,6 @@ createComponent({
4448 eles : [ ] as StickyEleInstance [ ]
4549 } ,
4650 computed : {
47- containerStyle ( ) {
48- return { }
49- } ,
5051 fixedEleStyle ( ) {
5152 return {
5253 top : `${ this . offset } px`
You can’t perform that action at this time.
0 commit comments