File tree 11 files changed +89
-13
lines changed
11 files changed +89
-13
lines changed Original file line number Diff line number Diff line change 24
24
items =" {{ list }}"
25
25
visible =" {{ slotVisible }}"
26
26
onCancel =" closeTour"
27
- onChange =" onChange" >
27
+ onChange =" onChange"
28
+ jumpText =" 跳过"
29
+ gotItText =" 知道了"
30
+ prevStepText =" 上一步"
31
+ nextStepText =" 下一步" >
28
32
<view
29
33
class =" step-box"
30
34
slot =" step"
Original file line number Diff line number Diff line change 20
20
inline
21
21
size =" small"
22
22
onTap =" onCancel" >
23
- 跳过
23
+ {{ jumpText }}
24
24
</ant-button >
25
25
<ant-button
26
26
a : if =" {{ utils.checkShowPrev(mixin.value, items) }}"
27
27
inline
28
28
size =" small"
29
29
onTap =" onPrev"
30
30
data-currentValue =" {{ mixin.value }}" >
31
- 上一步
31
+ {{ prevStepText }}
32
32
</ant-button >
33
33
<ant-button
34
34
a : if =" {{ utils.checkShowNext(mixin.value, items) }}"
35
35
inline
36
36
size =" small"
37
37
onTap =" onNext"
38
38
data-currentValue =" {{ mixin.value }}" >
39
- 下一步
39
+ {{ nextStepText }}
40
40
</ant-button >
41
41
<ant-button
42
42
a : if =" {{ utils.checkShowKnow(mixin.value, items) }}"
43
43
inline
44
44
size =" small"
45
45
onTap =" onCancel" >
46
- 知道了
46
+ {{ gotItText }}
47
47
</ant-button >
48
48
</view >
49
49
<block a : if =" {{ swiperable }}" >
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ toc: 'content'
36
36
| ` visible ` | 是否显示 | ` boolean ` | ` false ` |
37
37
| ` onCancel ` | 关闭回调 | ` () => void ` | - |
38
38
| ` onChange ` | 步骤改变回调 | ` (index: number) => void ` | - |
39
+ | ` jumpText ` | 跳过按钮的文案 | ` string ` | '跳过' |
40
+ | ` prevStepText ` | 上一步按钮的文案 | ` string ` | '上一步' |
41
+ | ` nextStepText ` | 下一步按钮的文案 | ` string ` | '下一步' |
42
+ | ` gotItText ` | 知道了按钮的文案 | ` string ` | '知道了' |
39
43
40
44
### GuideTourItem
41
45
Original file line number Diff line number Diff line change @@ -65,13 +65,37 @@ export interface IGuideTour extends IBaseProps {
65
65
* @description 步骤改变回调
66
66
*/
67
67
onChange : ( index : number ) => boolean ;
68
+ /**
69
+ * @description 上一步按钮文案
70
+ * @default "上一步"
71
+ */
72
+ prevStepText ?: string ;
73
+ /**
74
+ * @description 下一步按钮文案
75
+ * @default "下一步"
76
+ */
77
+ nextStepText ?: string ;
78
+ /**
79
+ * @description 知道了按钮文案
80
+ * @default "知道了"
81
+ */
82
+ gotItText ?: string ;
83
+ /**
84
+ * @description 跳过按钮文案
85
+ * @default "跳过"
86
+ */
87
+ jumpText ?: string ;
68
88
}
69
89
70
90
export const GuideTourDefaultProps : Partial < IGuideTour > = {
71
91
visible : false ,
72
92
swiperable : false ,
73
93
items : [ ] ,
74
94
defaultCurrent : 0 ,
95
+ gotItText : '知道了' ,
96
+ nextStepText : '下一步' ,
97
+ prevStepText : '上一步' ,
98
+ jumpText : '跳过'
75
99
} ;
76
100
77
101
export const GuideTourFunctionalProps : Partial < IGuideTour > = {
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ toc: 'content'
36
36
| ` visible ` | 是否显示 | ` boolean ` | ` false ` |
37
37
| ` onCancel ` | 关闭回调 | ` () => void ` | - |
38
38
| ` onChange ` | 步骤改变回调 | ` (index: number) => void ` | - |
39
+ | ` jumpText ` | 跳过按钮的文案 | ` string ` | '跳过' |
40
+ | ` prevStepText ` | 上一步按钮的文案 | ` string ` | '上一步' |
41
+ | ` nextStepText ` | 下一步按钮的文案 | ` string ` | '下一步' |
42
+ | ` gotItText ` | 知道了按钮的文案 | ` string ` | '知道了' |
39
43
40
44
### GuideTourItem
41
45
Original file line number Diff line number Diff line change 20
20
inline
21
21
size="small"
22
22
bind:tap="onCancel">
23
- 跳过
23
+ {{ jumpText }}
24
24
</ant-button>
25
25
<ant-button
26
26
wx:if="{{ utils.checkShowPrev(mixin.value, items) }}"
27
27
inline
28
28
size="small"
29
29
bind:tap="onPrev"
30
30
data-currentValue="{{ mixin.value }}">
31
- 上一步
31
+ {{ prevStepText }}
32
32
</ant-button>
33
33
<ant-button
34
34
wx:if="{{ utils.checkShowNext(mixin.value, items) }}"
35
35
inline
36
36
size="small"
37
37
bind:tap="onNext"
38
38
data-currentValue="{{ mixin.value }}">
39
- 下一步
39
+ {{ nextStepText }}
40
40
</ant-button>
41
41
<ant-button
42
42
wx:if="{{ utils.checkShowKnow(mixin.value, items) }}"
43
43
inline
44
44
size="small"
45
45
bind:tap="onCancel">
46
- 知道了
46
+ {{ gotItText }}
47
47
</ant-button>
48
48
</view>
49
49
<block wx:if="{{ swiperable }}">
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ export var GuideTourDefaultProps = {
3
3
swiperable : false ,
4
4
items : [ ] ,
5
5
defaultCurrent : 0 ,
6
+ gotItText : '知道了' ,
7
+ nextStepText : '下一步' ,
8
+ prevStepText : '上一步' ,
9
+ jumpText : '跳过'
6
10
} ;
7
11
export var GuideTourFunctionalProps = {
8
12
maskStyle : '' ,
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ export default ({
46
46
visible = { slotVisible }
47
47
onCancel = "closeTour"
48
48
onChange = "onChange"
49
+ jumpText = '跳过'
50
+ gotItText = '知道了'
51
+ prevStepText = '上一步'
52
+ nextStepText = '下一步'
49
53
>
50
54
< View class = "step-box" slot = "step" slot-scope = "props" >
51
55
step-{ props . index }
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ export default (
24
24
items,
25
25
visible,
26
26
swiperable,
27
+ jumpText,
28
+ nextStepText,
29
+ prevStepText,
30
+ gotItText
27
31
} : TSXMLProps < IGuideTour > ,
28
32
{ mixin, current } : InternalData
29
33
) => (
@@ -43,7 +47,7 @@ export default (
43
47
< View class = "ant-guide-tour-button" >
44
48
{ utils . checkShowJump ( mixin . value , items ) && (
45
49
< AntButton inline size = "small" onTap = "onCancel" >
46
- 跳过
50
+ { jumpText }
47
51
</ AntButton >
48
52
) }
49
53
{ utils . checkShowPrev ( mixin . value , items ) && (
@@ -53,7 +57,7 @@ export default (
53
57
onTap = "onPrev"
54
58
data-currentValue = { mixin . value }
55
59
>
56
- 上一步
60
+ { prevStepText }
57
61
</ AntButton >
58
62
) }
59
63
{ utils . checkShowNext ( mixin . value , items ) && (
@@ -63,12 +67,12 @@ export default (
63
67
onTap = "onNext"
64
68
data-currentValue = { mixin . value }
65
69
>
66
- 下一步
70
+ { nextStepText }
67
71
</ AntButton >
68
72
) }
69
73
{ utils . checkShowKnow ( mixin . value , items ) && (
70
74
< AntButton inline size = "small" onTap = "onCancel" >
71
- 知道了
75
+ { gotItText }
72
76
</ AntButton >
73
77
) }
74
78
</ View >
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ toc: 'content'
36
36
| ` visible ` | 是否显示 | ` boolean ` | ` false ` |
37
37
| ` onCancel ` | 关闭回调 | ` () => void ` | - |
38
38
| ` onChange ` | 步骤改变回调 | ` (index: number) => void ` | - |
39
+ | ` jumpText ` | 跳过按钮的文案 | ` string ` | '跳过' |
40
+ | ` prevStepText ` | 上一步按钮的文案 | ` string ` | '上一步' |
41
+ | ` nextStepText ` | 下一步按钮的文案 | ` string ` | '下一步' |
42
+ | ` gotItText ` | 知道了按钮的文案 | ` string ` | '知道了' |
39
43
40
44
### GuideTourItem
41
45
Original file line number Diff line number Diff line change @@ -65,13 +65,37 @@ export interface IGuideTour extends IBaseProps {
65
65
* @description 步骤改变回调
66
66
*/
67
67
onChange : ( index : number ) => boolean ;
68
+ /**
69
+ * @description 上一步按钮文案
70
+ * @default "上一步"
71
+ */
72
+ prevStepText ?: string ;
73
+ /**
74
+ * @description 下一步按钮文案
75
+ * @default "下一步"
76
+ */
77
+ nextStepText ?: string ;
78
+ /**
79
+ * @description 知道了按钮文案
80
+ * @default "知道了"
81
+ */
82
+ gotItText ?: string ;
83
+ /**
84
+ * @description 跳过按钮文案
85
+ * @default "跳过"
86
+ */
87
+ jumpText ?: string ;
68
88
}
69
89
70
90
export const GuideTourDefaultProps : Partial < IGuideTour > = {
71
91
visible : false ,
72
92
swiperable : false ,
73
93
items : [ ] ,
74
94
defaultCurrent : 0 ,
95
+ gotItText : '知道了' ,
96
+ nextStepText : '下一步' ,
97
+ prevStepText : '上一步' ,
98
+ jumpText : '跳过'
75
99
} ;
76
100
77
101
export const GuideTourFunctionalProps : Partial < IGuideTour > = {
You can’t perform that action at this time.
0 commit comments