@xtdev/xt-miniprogram-ui 1.2.30 → 1.2.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libs/xt-steps/README.md +28 -10
- package/libs/xt-steps/index.wxml +7 -9
- package/package.json +1 -1
package/libs/xt-steps/README.md
CHANGED
|
@@ -42,20 +42,38 @@
|
|
|
42
42
|
<xt-steps type="brief" direction="vertical" steps="{{steps}}" active="{{active}}"></xt-steps>
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
### 插槽模式,纵向展示
|
|
46
|
+
提示:插槽name规则为slot-{{index}} index从0开始
|
|
47
|
+

|
|
48
|
+
```
|
|
49
|
+
<xt-steps type="brief" direction="vertical" steps="{{steps}}" active="{{active}}">
|
|
50
|
+
<view slot="slot-1" class="custom-box">
|
|
51
|
+
<view slot:listIndex>订单编号:123456{{ listIndex }}</view>
|
|
52
|
+
<xt-button style="margin-left: 20rpx" size="small">复制</xt-button>
|
|
53
|
+
</view>
|
|
54
|
+
<view slot="slot-2" class="custom-box">
|
|
55
|
+
<view slot:listIndex>订单编号:123456777{{ listIndex }}</view>
|
|
56
|
+
<xt-button style="margin-left: 20rpx" size="small">复制</xt-button>
|
|
57
|
+
</view>
|
|
58
|
+
</xt-steps>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
|
|
45
62
|
##API
|
|
46
63
|
|
|
47
64
|
#### xt-steps props
|
|
48
65
|
|
|
49
|
-
| 参数 | 说明
|
|
50
|
-
|
|
|
51
|
-
| steps
|
|
52
|
-
| active
|
|
53
|
-
| type
|
|
54
|
-
| direction
|
|
66
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
67
|
+
| --------- | ------------------------------------ | ------------- | ---------- |
|
|
68
|
+
| steps | 步骤配置集合 | `stepsItem[]` | [] |
|
|
69
|
+
| active | 当前步骤 | `Number` | 0 |
|
|
70
|
+
| type | 当前步骤,可选值static、brief | `String` | static |
|
|
71
|
+
| direction | 展示方向,可选值horizontal、vertical | `String` | horizontal |
|
|
55
72
|
|
|
56
73
|
#### stepsItem Props
|
|
57
74
|
|
|
58
|
-
| 参数
|
|
59
|
-
|
|
|
60
|
-
| title
|
|
61
|
-
| desc
|
|
75
|
+
| 参数 | 说明 | 类型 |
|
|
76
|
+
| ----- | -------- | --------- |
|
|
77
|
+
| title | 标题 | `String` |
|
|
78
|
+
| desc | 副标题 | `String` |
|
|
79
|
+
| slot | 是否插槽 | `Boolean` |
|
package/libs/xt-steps/index.wxml
CHANGED
|
@@ -9,28 +9,26 @@
|
|
|
9
9
|
</view>
|
|
10
10
|
<view class="step-title">{{item.title}}</view>
|
|
11
11
|
<view class="step-desc">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
<view wx:if="{{index < steps.length - 1}}" class="{{type === 'brief' ? 'step-line-brief' : 'step-line'}}">
|
|
12
|
+
<slot wx:if="{{item.slot}}" name="slot-{{index}}" list-index="{{ index }}" item="{{ item }}" />
|
|
13
|
+
<rich-text wx:else nodes="{{item.desc}}"></rich-text>
|
|
15
14
|
</view>
|
|
15
|
+
<view wx:if="{{index < steps.length - 1}}" class="{{type === 'brief' ? 'step-line-brief' : 'step-line'}}"></view>
|
|
16
16
|
</view>
|
|
17
17
|
</view>
|
|
18
|
-
|
|
19
18
|
<view wx:if="{{direction === 'vertical'}}" class="{{type === 'brief' ? 'xt-steps xt-steps-column xt-steps-column-brief' : 'xt-steps xt-steps-column'}}">
|
|
20
19
|
<view wx:for="{{steps}}" wx:key="index" class="{{ active > index ? 'finished xt-step' : (active === index ? 'xt-step active' : 'xt-step')}}">
|
|
21
20
|
<view wx:if="{{type === 'static'}}" class="step-dot">
|
|
22
21
|
<xt-icon wx:if="{{active > index}}" icon="zhengque"></xt-icon>
|
|
23
22
|
<view wx:else>{{index+1}}</view>
|
|
24
23
|
</view>
|
|
25
|
-
<view wx:if="{{type === 'brief'}}" class="step-dot-brief">
|
|
26
|
-
</view>
|
|
24
|
+
<view wx:if="{{type === 'brief'}}" class="step-dot-brief"></view>
|
|
27
25
|
<view class="text-box">
|
|
28
26
|
<view class="step-title">{{item.title}}</view>
|
|
29
27
|
<view class="step-desc">
|
|
30
|
-
<
|
|
28
|
+
<slot wx:if="{{item.slot}}" name="slot-{{index}}" list-index="{{ index }}" item="{{ item }}" />
|
|
29
|
+
<rich-text wx:else nodes="{{item.desc}}"></rich-text>
|
|
31
30
|
</view>
|
|
32
31
|
</view>
|
|
33
|
-
<view wx:if="{{index < steps.length - 1}}" class="{{type === 'brief' ? 'step-line-brief' : 'step-line'}}">
|
|
34
|
-
</view>
|
|
32
|
+
<view wx:if="{{index < steps.length - 1}}" class="{{type === 'brief' ? 'step-line-brief' : 'step-line'}}"></view>
|
|
35
33
|
</view>
|
|
36
34
|
</view>
|