Skip to content

Commit 365d6e5

Browse files
authored
fix(Guide): fix the hideSkip attribute being invalid (#3371)
1 parent 6d7c4c7 commit 365d6e5

File tree

5 files changed

+25
-16
lines changed

5 files changed

+25
-16
lines changed

src/guide/_example/guide.wxml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<t-navbar class="demo-navbar" title="Guide" leftArrow />
1+
<view class="custom-navbar">
2+
<t-navbar class="demo-navbar" title="Guide" leftArrow />
3+
</view>
24

35
<view class="demo">
46
<view class="demo-title">Guide 引导</view>

src/guide/content.wxml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<import src="../common/template/button.wxml" />
22
<template name="content">
3-
<slot wx:if="{{!title && !body}}" name="content-{{current}}"></slot>
3+
<slot wx:if="{{!title && !body}}" name="content-{{current}}" />
44
<block wx:else>
55
<view class="{{prefix}}-class-tooltip">
66
<view wx:if="{{title}}" class="{{prefix}}-class-title {{classPrefix}}__title--{{modeType}}">{{title}}</view>
7-
<slot wx:else name="title-{{current}}"></slot>
7+
<slot wx:else name="title-{{current}}" />
88
<view wx:if="{{body}}" class="{{prefix}}-class-body {{classPrefix}}__body--{{modeType}}">{{body}}</view>
9-
<slot wx:else name="body-{{current}}"></slot>
9+
<slot wx:else name="body-{{current}}" />
1010
</view>
1111
<view class="{{prefix}}-class-footer {{classPrefix}}__footer {{classPrefix}}__footer--{{modeType}}">
12-
<template is="button" wx:if="{{current < steps.length - 1}}" data="{{...skipButton}}"></template>
13-
<template is="button" wx:else data="{{...backButton}}"></template>
14-
<template is="button" wx:if="{{current < steps.length - 1}}" data="{{...nextButton}}"></template>
15-
<template is="button" wx:else data="{{...finishButton}}"></template>
12+
<template is="button" wx:if="{{current < steps.length - 1 && !hideSkip}}" data="{{...skipButton}}" />
13+
<template is="button" wx:else data="{{...backButton}}" />
14+
<template is="button" wx:if="{{current < steps.length - 1}}" data="{{...nextButton}}" />
15+
<template is="button" wx:else data="{{...finishButton}}" />
1616
</view>
1717
</block>
1818
</template>

src/guide/guide.less

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@
4646
box-shadow: 0 0 0 0 @guide-reference-mask-color, @guide-reference-mask-color 0 0 0 5000px;
4747
border-radius: @guide-reference-border-radius;
4848
transition: all @anim-duration-base @anim-time-fn-ease-out;
49+
4950
&--nonoverlay {
5051
box-shadow: none;
5152
border: @guide-reference-border;
5253
}
5354
}
55+
5456
&__container {
5557
display: inline-block;
58+
5659
&--popover {
5760
background-color: @guide-popover-bg-color;
5861
border: @guide-popover-border;
@@ -62,27 +65,31 @@
6265
min-width: @guide-popover-min-width;
6366
max-width: @guide-popover-max-width;
6467
}
68+
6569
&--dialog {
6670
background-color: @guide-popover-bg-color;
6771
border-radius: @guide-dialog-border-radius;
6872
padding: @guide-dialog-padding;
6973
width: @guide-dialog-width;
7074
}
7175
}
76+
7277
&__title--popover {
7378
text-align: @guide-popover-title-text-align;
7479
color: @guide-title-color;
7580
font-size: @guide-popover-title-font-size;
7681
font-weight: @guide-title-font-weight;
7782
line-height: @guide-popover-title-line-height;
7883
}
84+
7985
&__title--dialog {
8086
text-align: @guide-dialog-title-text-align;
8187
color: @guide-title-color;
8288
font-size: @guide-dialog-title-font-size;
8389
font-weight: @guide-title-font-weight;
8490
line-height: @guide-dialog-title-line-height;
8591
}
92+
8693
&__body--popover {
8794
margin-top: @guide-popover-body-margin-top;
8895
text-align: @guide-popover-body-text-align;
@@ -91,6 +98,7 @@
9198
font-weight: @guide-body-font-weight;
9299
line-height: @guide-popover-body-line-height;
93100
}
101+
94102
&__body--dialog {
95103
margin-top: @guide-dialog-body-margin-top;
96104
text-align: @guide-dialog-body-text-align;
@@ -99,18 +107,19 @@
99107
font-weight: @guide-body-font-weight;
100108
line-height: @guide-dialog-body-line-height;
101109
}
110+
102111
&__footer {
103112
text-align: @guide-footer-text-align;
104113
margin-top: @guide-footer-margin-top;
114+
105115
.@{prefix}-guide__button + .@{prefix}-guide__button {
106116
margin-left: @guide-footer-button-space;
107117
}
108-
.@{prefix}-guide__button--hidden {
109-
display: none;
110-
}
118+
111119
&--dialog {
112120
display: flex;
113121
padding: @guide-dialog-footer-button-padding;
122+
114123
.@{prefix}-guide__button:last-child {
115124
flex-grow: 1;
116125
}

src/guide/guide.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ export default class Guide extends SuperComponent {
126126
content: '跳过',
127127
size,
128128
...skipButton,
129-
class: `${prefix}-class-skip ${name}__button ${step.hideSkip ? `${name}__button--hidden` : ''} ${
130-
skipButton?.class || ''
131-
}`,
129+
class: `${prefix}-class-skip ${name}__button ${skipButton?.class || ''}`,
132130
type: 'skip',
133131
};
134132
let nextButton = step.nextButtonProps ?? this.data.nextButtonProps;

src/guide/guide.wxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
>
1919
<template
2020
is="content"
21-
data="{{ prefix: prefix, classPrefix: classPrefix, title: title, body: body, steps: steps, current: current, modeType: modeType, ...buttonProps }}"
21+
data="{{ prefix, classPrefix, title, body, steps, current, modeType, hideSkip, ...buttonProps }}"
2222
/>
2323
</view>
2424
</view>
@@ -37,7 +37,7 @@
3737
>
3838
<template
3939
is="content"
40-
data="{{ prefix: prefix, classPrefix: classPrefix, title: title, body: body, steps: steps, current: current, modeType: modeType, ...buttonProps }}"
40+
data="{{ prefix, classPrefix, title, body, steps, current, modeType, hideSkip, ...buttonProps }}"
4141
/>
4242
</view>
4343
</view>

0 commit comments

Comments
 (0)