@xtdev/xt-miniprogram-ui 1.2.30 → 1.2.33

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.
@@ -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
+ ![效果图](https://img.tanjiu.cn/home/tcD7PAr3XDSfKZbYwXPGe4XBc2zbDk5M.png "步骤条效果图")
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 | 步骤配置集合 | `stepsItem[]` | [] |
52
- | active | 当前步骤 | `Number` | 0 |
53
- | type | 当前步骤,可选值static、brief | `String` | static |
54
- | direction | 展示方向,可选值horizontal、vertical | `String` | horizontal |
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 | 标题 | `String` |
61
- | desc | 副标题 | `String` |
75
+ | 参数 | 说明 | 类型 |
76
+ | ----- | -------- | --------- |
77
+ | title | 标题 | `String` |
78
+ | desc | 副标题 | `String` |
79
+ | slot | 是否插槽 | `Boolean` |
@@ -9,28 +9,26 @@
9
9
  </view>
10
10
  <view class="step-title">{{item.title}}</view>
11
11
  <view class="step-desc">
12
- <rich-text nodes="{{item.desc}}"></rich-text>
13
- </view>
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
- <rich-text nodes="{{item.desc}}"></rich-text>
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>
@@ -159,6 +159,8 @@
159
159
  width: 16rpx;
160
160
  height: 16rpx;
161
161
  border-radius: 50%;
162
+ flex-shrink: 0;
163
+ flex-grow: 0;
162
164
  }
163
165
 
164
166
  .xt-steps-column .active .step-dot-brief {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtdev/xt-miniprogram-ui",
3
- "version": "1.2.30",
3
+ "version": "1.2.33",
4
4
  "description": "",
5
5
  "miniprogram": "libs",
6
6
  "publishConfig": {