Skip to content

Commit 28087d2

Browse files
committed
chore: 1.4.15-beta.2
1 parent 1728659 commit 28087d2

5 files changed

Lines changed: 21 additions & 21 deletions

File tree

packages/mpx-cube-ui/lib/components/scroll-nav-bar/index.mpx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
is-active="{{ item.isActive }}"
3232
active-class="{{ item.activeClass }}"
3333
></nav-item-content>
34-
<rich-text wx:else class="nav-item-inner" nodes="{{ item.txt }}"></rich-text>
34+
<rich-text wx:else class="cube-nav-item-inner" nodes="{{ item.txt }}"></rich-text>
3535
</block>
3636
<block @_web>
3737
<slot
@@ -44,7 +44,7 @@
4444
isActive="{{ item.isActive }}"
4545
activeClass="{{ item.activeClass }}"
4646
></slot>
47-
<rich-text wx:else class="nav-item-inner" nodes="{{ item.txt }}"></rich-text>
47+
<rich-text wx:else class="cube-nav-item-inner" nodes="{{ item.txt }}"></rich-text>
4848
</block>
4949
</view>
5050
</view>
@@ -65,7 +65,7 @@
6565
&_vertical
6666
height 100%
6767

68-
.scroll-container
68+
.cube-scroll-container
6969
width 100%
7070
height 90rpx
7171
white-space nowrap
@@ -74,7 +74,7 @@
7474
height 100%
7575
white-space normal
7676

77-
.scroll-content
77+
.cube-scroll-content
7878
display inline-flex
7979
width max-content
8080
align-items center
@@ -91,7 +91,7 @@
9191
min-height 100%
9292
padding 12rpx 0
9393

94-
.nav-item
94+
.cube-nav-item
9595
position relative
9696
display inline-flex
9797
align-items center
@@ -106,10 +106,10 @@
106106
transition color 0.2s
107107
box-sizing border-box
108108

109-
&.active
109+
&.cube-active
110110
color $color-primary
111111

112-
&.disabled
112+
&.cube-disabled
113113
color #c8c9cc
114114

115115
&_vertical
@@ -118,12 +118,12 @@
118118
padding 24rpx 28rpx
119119
justify-content center
120120

121-
.nav-item-inner
121+
.cube-nav-item-inner
122122
width 100%
123123
justify-content center
124124
text-align center
125125

126-
.nav-item-inner
126+
.cube-nav-item-inner
127127
display flex
128128
align-items center
129129
justify-content center

packages/mpx-cube-ui/lib/components/scroll-nav-bar/nav-item-content.mpx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<rich-text @_web|_wx|_ali class="nav-item-inner" nodes="{{ txt }}"></rich-text>
2+
<rich-text @_web|_wx|_ali class="cube-nav-item-inner" nodes="{{ txt }}"></rich-text>
33
</template>
44

55
<script lang="ts">

packages/mpx-cube-ui/lib/components/scroll-nav-bar/scroll-nav-bar.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const ITEM_ID_PREFIX = 'cube-scroll-nav-item-';
33
const DIRECTION_HORIZONTAL = 'horizontal';
44
const DIRECTION_VERTICAL = 'vertical';
55
const ROOT_CLASS = 'cube-scroll-nav-bar';
6-
const CONTAINER_CLASS = 'scroll-container';
7-
const CONTENT_CLASS = 'scroll-content';
6+
const CONTAINER_CLASS = 'cube-scroll-container';
7+
const CONTENT_CLASS = 'cube-scroll-content';
88
let scrollNavBarInstanceSeed = 0;
99
function createItemIdPrefix() {
1010
return `${ITEM_ID_PREFIX}${scrollNavBarInstanceSeed++}-`;
@@ -195,7 +195,7 @@ createComponent({
195195
disabled,
196196
isActive: false,
197197
activeClass: '',
198-
className: 'nav-item'
198+
className: 'cube-nav-item'
199199
};
200200
});
201201
},
@@ -255,20 +255,20 @@ createComponent({
255255
const isVertical = direction === DIRECTION_VERTICAL;
256256
return navItems.map((item, index) => {
257257
const isActive = index === activeIndex;
258-
const classNames = ['nav-item'];
258+
const classNames = ['cube-nav-item'];
259259
if (isActive) {
260-
classNames.push('active');
260+
classNames.push('cube-active');
261261
}
262262
if (item.disabled) {
263-
classNames.push('disabled');
263+
classNames.push('cube-disabled');
264264
}
265265
if (isVertical) {
266-
classNames.push('nav-item_vertical');
266+
classNames.push('cube-nav-item_vertical');
267267
}
268268
return {
269269
...item,
270270
isActive,
271-
activeClass: isActive ? 'active' : '',
271+
activeClass: isActive ? 'cube-active' : '',
272272
className: classNames.join(' ')
273273
};
274274
});

packages/mpx-cube-ui/lib/components/sticky/sticky.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ createComponent({
9191
else {
9292
oldEle?.refresh();
9393
oldEle?.setContentStyle({});
94-
newEle.setContentStyle({
94+
newEle?.setContentStyle({
9595
position: 'fixed',
9696
top: this.rootRect.top + this.offset + 'px',
9797
left: this.rootRect.left + 'px',
@@ -187,7 +187,7 @@ createComponent({
187187
query.selectAll('.cube-sticky-ele').boundingClientRect((rects) => {
188188
(rects || []).forEach((rect) => {
189189
this.rects.push(rect);
190-
this.positions[index] = (rect?.top || 0) - rootTop;
190+
this.positions[index] = (rect?.top || 0) - rootTop + this.pos;
191191
this.heights[index] = rect?.height || 0;
192192
});
193193
});

packages/mpx-cube-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/mpx-cube-ui",
3-
"version": "1.4.15-beta.1",
3+
"version": "1.4.15-beta.2",
44
"description": "mpx components library",
55
"author": "xiaolei <xiaolei@didichuxing.com>",
66
"publishConfig": {

0 commit comments

Comments
 (0)