stellar-ui-plus 1.18.1 → 1.18.3

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.
Files changed (99) hide show
  1. package/components/ste-animate/README.md +40 -36
  2. package/components/ste-animate/ste-animate.vue +1 -1
  3. package/components/ste-badge/README.md +149 -80
  4. package/components/ste-badge/ste-badge.vue +1 -1
  5. package/components/ste-barcode/README.md +6 -2
  6. package/components/ste-barcode/ste-barcode.vue +5 -1
  7. package/components/ste-button/README.md +47 -27
  8. package/components/ste-button/ste-button.vue +2 -24
  9. package/components/ste-calendar/README.md +270 -103
  10. package/components/ste-calendar/ste-calendar.vue +10 -11
  11. package/components/ste-checkbox/README.md +188 -164
  12. package/components/ste-code-input/README.md +21 -10
  13. package/components/ste-date-picker/README.md +35 -23
  14. package/components/ste-drag/ATTRIBUTES.md +1 -1
  15. package/components/ste-drag/README.md +22 -16
  16. package/components/ste-drag/ste-drag.easycom.json +8 -2
  17. package/components/ste-drag/ste-drag.vue +27 -3
  18. package/components/ste-dropdown-menu/README.md +128 -112
  19. package/components/ste-icon/README.md +27 -18
  20. package/components/ste-image/README.md +16 -10
  21. package/components/ste-image/ste-image.vue +1 -1
  22. package/components/ste-index-item/ste-index-item.vue +1 -1
  23. package/components/ste-index-list/README.md +58 -28
  24. package/components/ste-input/README.md +61 -33
  25. package/components/ste-loading/README.md +24 -12
  26. package/components/ste-loading/ste-loading.vue +1 -1
  27. package/components/ste-media-preview/ste-media-preview.vue +2 -1
  28. package/components/ste-message-box/README.md +151 -102
  29. package/components/ste-message-box/ste-message-box.ts +5 -1
  30. package/components/ste-message-box/ste-message-box.vue +21 -9
  31. package/components/ste-message-box/use-message-box.ts +8 -15
  32. package/components/ste-notice-bar/README.md +82 -29
  33. package/components/ste-notice-bar/ste-notice-bar.vue +1 -1
  34. package/components/ste-number-keyboard/KeyboardVue.vue +1 -1
  35. package/components/ste-number-keyboard/README.md +198 -73
  36. package/components/ste-number-keyboard/props.ts +36 -30
  37. package/components/ste-number-keyboard/ste-number-keyboard.vue +3 -1
  38. package/components/ste-number-keyboard/useData.ts +133 -127
  39. package/components/ste-popup/README.md +127 -41
  40. package/components/ste-popup/ste-popup.vue +6 -2
  41. package/components/ste-price/README.md +50 -32
  42. package/components/ste-price/ste-price.vue +1 -1
  43. package/components/ste-progress/README.md +33 -16
  44. package/components/ste-progress/ste-progress.vue +1 -1
  45. package/components/ste-qrcode/README.md +9 -3
  46. package/components/ste-radio/README.md +139 -64
  47. package/components/ste-rate/README.md +36 -20
  48. package/components/ste-rate/ste-rate.vue +0 -2
  49. package/components/ste-read-more/README.md +21 -13
  50. package/components/ste-read-more/ste-read-more.vue +2 -2
  51. package/components/ste-rich-text/README.md +6 -2
  52. package/components/ste-rich-text/ste-rich-text.vue +12 -2
  53. package/components/ste-scroll-to/README.md +11 -9
  54. package/components/ste-search/README.md +195 -68
  55. package/components/ste-select/README.md +1 -1
  56. package/components/ste-signature/README.md +4 -2
  57. package/components/ste-signature/ste-signature.vue +1 -0
  58. package/components/ste-slider/ATTRIBUTES.md +2 -2
  59. package/components/ste-slider/README.md +46 -27
  60. package/components/ste-slider/ste-slider.easycom.json +2 -2
  61. package/components/ste-slider/ste-slider.vue +9 -5
  62. package/components/ste-slider/useData.ts +83 -66
  63. package/components/ste-stepper/README.md +77 -102
  64. package/components/ste-stepper/ste-stepper.vue +3 -3
  65. package/components/ste-steps/README.md +80 -55
  66. package/components/ste-sticky/README.md +13 -11
  67. package/components/ste-sticky/ste-sticky.vue +5 -1
  68. package/components/ste-swipe-action/README.md +137 -87
  69. package/components/ste-swiper/README.md +78 -64
  70. package/components/ste-switch/README.md +50 -52
  71. package/components/ste-switch/ste-switch.vue +2 -1
  72. package/components/ste-table/README.md +130 -109
  73. package/components/ste-tabs/README.md +37 -35
  74. package/components/ste-text/README.md +25 -19
  75. package/components/ste-text/ste-text.vue +1 -0
  76. package/components/ste-toast/README.md +151 -106
  77. package/components/ste-toast/ste-toast.vue +3 -1
  78. package/components/ste-touch-swipe/README.md +49 -21
  79. package/components/ste-tour/README.md +15 -15
  80. package/components/ste-tree/README.md +246 -88
  81. package/components/ste-upload/README.md +32 -16
  82. package/components/ste-upload/ste-upload.vue +3 -3
  83. package/components/ste-video/README.md +6 -2
  84. package/components/ste-video/ste-video.vue +1 -11
  85. package/components/ste-watermark/ATTRIBUTES.md +17 -0
  86. package/components/ste-watermark/README.md +63 -0
  87. package/components/ste-watermark/config.json +5 -0
  88. package/components/ste-watermark/props.ts +96 -0
  89. package/components/ste-watermark/ste-watermark.easycom.json +89 -0
  90. package/components/ste-watermark/ste-watermark.vue +160 -0
  91. package/config/font-size.ts +84 -0
  92. package/config/index.ts +37 -46
  93. package/index.ts +2 -0
  94. package/package.json +2 -3
  95. package/types/components.d.ts +2 -0
  96. package/types/index.d.ts +0 -1
  97. package/types/refComponents.d.ts +2 -0
  98. package/utils/System.ts +1 -1
  99. package/utils/utils.ts +20 -8
@@ -9,30 +9,32 @@
9
9
  #### 基础使用
10
10
 
11
11
  ```html
12
- <ste-animate type="shakeX" loop>
13
- <ste-button>shakeX-横向</ste-button>
14
- </ste-animate>
15
- <ste-animate type="shakeY" loop>
16
- <ste-button>shakeY-竖向</ste-button>
17
- </ste-animate>
18
- <ste-animate type="ripple" loop>
19
- <ste-button>ripple-心跳</ste-button>
20
- </ste-animate>
21
- <ste-animate type="breath" loop>
22
- <ste-button>breath-呼吸灯</ste-button>
23
- </ste-animate>
24
- <ste-animate type="twinkle" loop>
25
- <ste-button>twinkle-水波</ste-button>
26
- </ste-animate>
27
- <ste-animate type="flicker" loop>
28
- <ste-button>flicker-擦亮</ste-button>
29
- </ste-animate>
30
- <ste-animate type="jump" loop>
31
- <ste-button>jump-跳跃</ste-button>
32
- </ste-animate>
33
- <ste-animate type="float" loop>
34
- <ste-button>float-漂浮</ste-button>
35
- </ste-animate>
12
+ <template>
13
+ <ste-animate type="shakeX" loop>
14
+ <ste-button>shakeX-横向</ste-button>
15
+ </ste-animate>
16
+ <ste-animate type="shakeY" loop>
17
+ <ste-button>shakeY-竖向</ste-button>
18
+ </ste-animate>
19
+ <ste-animate type="ripple" loop>
20
+ <ste-button>ripple-心跳</ste-button>
21
+ </ste-animate>
22
+ <ste-animate type="breath" loop>
23
+ <ste-button>breath-呼吸灯</ste-button>
24
+ </ste-animate>
25
+ <ste-animate type="twinkle" loop>
26
+ <ste-button>twinkle-水波</ste-button>
27
+ </ste-animate>
28
+ <ste-animate type="flicker" loop>
29
+ <ste-button>flicker-擦亮</ste-button>
30
+ </ste-animate>
31
+ <ste-animate type="jump" loop>
32
+ <ste-button>jump-跳跃</ste-button>
33
+ </ste-animate>
34
+ <ste-animate type="float" loop>
35
+ <ste-button>float-漂浮</ste-button>
36
+ </ste-animate>
37
+ </template>
36
38
  ```
37
39
 
38
40
  #### 点击触发
@@ -40,18 +42,20 @@
40
42
  设置`action`为`click`
41
43
 
42
44
  ```html
43
- <ste-animate type="slide-right" action="click">
44
- <ste-button :stopPropagation="false">由右向左划入</ste-button>
45
- </ste-animate>
46
- <ste-animate type="slide-left" action="click">
47
- <ste-button :stopPropagation="false">由左向右划入</ste-button>
48
- </ste-animate>
49
- <ste-animate type="slide-top" action="click">
50
- <ste-button :stopPropagation="false">由上向下划入</ste-button>
51
- </ste-animate>
52
- <ste-animate type="slide-bottom" action="click">
53
- <ste-button :stopPropagation="false">由下向上划入</ste-button>
54
- </ste-animate>
45
+ <template>
46
+ <ste-animate type="slide-right" action="click">
47
+ <ste-button :stopPropagation="false">由右向左划入</ste-button>
48
+ </ste-animate>
49
+ <ste-animate type="slide-left" action="click">
50
+ <ste-button :stopPropagation="false">由左向右划入</ste-button>
51
+ </ste-animate>
52
+ <ste-animate type="slide-top" action="click">
53
+ <ste-button :stopPropagation="false">由上向下划入</ste-button>
54
+ </ste-animate>
55
+ <ste-animate type="slide-bottom" action="click">
56
+ <ste-button :stopPropagation="false">由下向上划入</ste-button>
57
+ </ste-animate>
58
+ </template>
55
59
  ```
56
60
 
57
61
  #### 属性触发
@@ -57,7 +57,7 @@ function animated() {
57
57
  </script>
58
58
 
59
59
  <template>
60
- <view class="ste-animate-root" :class="[cmpRootClass]" :style="[cmpRootStyle]" @click="handleClick">
60
+ <view class="ste-animate-root" :class="[cmpRootClass]" :style="[cmpRootStyle]" @click="handleClick" data-test="animate">
61
61
  <slot></slot>
62
62
  </view>
63
63
  </template>
@@ -6,31 +6,30 @@
6
6
 
7
7
  ### 代码演示
8
8
 
9
- - 以下代码公共样式
10
-
11
- ```css
12
- .avator {
13
- height: 80rpx;
14
- width: 80rpx;
15
- border-radius: 8rpx;
16
- background-color: #f2f3f5;
17
- }
18
- ```
19
-
20
9
  #### 徽标内容
21
10
 
22
11
  通过`content`属性,设置子元素的右上角的徽标
23
12
 
24
13
  ```html
25
- <ste-badge content="1">
26
- <view class="avator"></view>
27
- </ste-badge>
28
- <ste-badge content="99+">
29
- <view class="avator"></view>
30
- </ste-badge>
31
- <ste-badge content="hot">
32
- <view class="avator"></view>
33
- </ste-badge>
14
+ <template>
15
+ <ste-badge content="1">
16
+ <view class="avator"></view>
17
+ </ste-badge>
18
+ <ste-badge content="99+">
19
+ <view class="avator"></view>
20
+ </ste-badge>
21
+ <ste-badge content="hot">
22
+ <view class="avator"></view>
23
+ </ste-badge>
24
+ </template>
25
+ <style>
26
+ .avator {
27
+ height: 80rpx;
28
+ width: 80rpx;
29
+ border-radius: 8rpx;
30
+ background-color: #f2f3f5;
31
+ }
32
+ </style>
34
33
  ```
35
34
 
36
35
  #### 背景
@@ -40,15 +39,25 @@
40
39
  - 支持纯色、渐变色、背景图
41
40
 
42
41
  ```html
43
- <ste-badge content="1" background="rgb(19, 183, 22)">
44
- <view class="avator"></view>
45
- </ste-badge>
46
- <ste-badge content="99+" background="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))">
47
- <view class="avator"></view>
48
- </ste-badge>
49
- <ste-badge content="" showZero background="https://image.whzb.com/chain/StellarUI/image/fire.png">
50
- <view class="avator"></view>
51
- </ste-badge>
42
+ <template>
43
+ <ste-badge content="1" background="rgb(19, 183, 22)">
44
+ <view class="avator"></view>
45
+ </ste-badge>
46
+ <ste-badge content="99+" background="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))">
47
+ <view class="avator"></view>
48
+ </ste-badge>
49
+ <ste-badge content="" showZero background="https://image.whzb.com/chain/StellarUI/image/fire.png">
50
+ <view class="avator"></view>
51
+ </ste-badge>
52
+ </template>
53
+ <style>
54
+ .avator {
55
+ height: 80rpx;
56
+ width: 80rpx;
57
+ border-radius: 8rpx;
58
+ background-color: #f2f3f5;
59
+ }
60
+ </style>
52
61
  ```
53
62
 
54
63
  #### 小红点
@@ -56,12 +65,22 @@
56
65
  通过`showDot`属性,设置是否显示小红点
57
66
 
58
67
  ```html
59
- <ste-badge showDot>
60
- <view class="avator"></view>
61
- </ste-badge>
62
- <ste-badge showDot background="rgb(19, 183, 22)">
63
- <view class="avator"></view>
64
- </ste-badge>
68
+ <template>
69
+ <ste-badge showDot>
70
+ <view class="avator"></view>
71
+ </ste-badge>
72
+ <ste-badge showDot background="rgb(19, 183, 22)">
73
+ <view class="avator"></view>
74
+ </ste-badge>
75
+ </template>
76
+ <style>
77
+ .avator {
78
+ height: 80rpx;
79
+ width: 80rpx;
80
+ border-radius: 8rpx;
81
+ background-color: #f2f3f5;
82
+ }
83
+ </style>
65
84
  ```
66
85
 
67
86
  #### 徽标位置
@@ -69,18 +88,28 @@
69
88
  通过`position`属性,设置徽标的位置
70
89
 
71
90
  ```html
72
- <ste-badge content="1">
73
- <view class="avator"></view>
74
- </ste-badge>
75
- <ste-badge content="1" position="topLeft">
76
- <view class="avator"></view>
77
- </ste-badge>
78
- <ste-badge content="1" position="bottomLeft">
79
- <view class="avator"></view>
80
- </ste-badge>
81
- <ste-badge content="1" position="bottomRight">
82
- <view class="avator"></view>
83
- </ste-badge>
91
+ <template>
92
+ <ste-badge content="1">
93
+ <view class="avator"></view>
94
+ </ste-badge>
95
+ <ste-badge content="1" position="topLeft">
96
+ <view class="avator"></view>
97
+ </ste-badge>
98
+ <ste-badge content="1" position="bottomLeft">
99
+ <view class="avator"></view>
100
+ </ste-badge>
101
+ <ste-badge content="1" position="bottomRight">
102
+ <view class="avator"></view>
103
+ </ste-badge>
104
+ </template>
105
+ <style>
106
+ .avator {
107
+ height: 80rpx;
108
+ width: 80rpx;
109
+ border-radius: 8rpx;
110
+ background-color: #f2f3f5;
111
+ }
112
+ </style>
84
113
  ```
85
114
 
86
115
  #### 偏移
@@ -88,18 +117,28 @@
88
117
  当设置了`offsetX`或`offsetY`值时,徽标会基于当前设置徽标位置(`position`)往中心点进行偏移
89
118
 
90
119
  ```html
91
- <ste-badge content="1" :offsetX="5" :offsetY="5">
92
- <view class="avator"></view>
93
- </ste-badge>
94
- <ste-badge content="1" position="topLeft" :offsetX="5" :offsetY="5">
95
- <view class="avator"></view>
96
- </ste-badge>
97
- <ste-badge content="1" position="bottomLeft" :offsetX="5" :offsetY="5">
98
- <view class="avator"></view>
99
- </ste-badge>
100
- <ste-badge content="1" position="bottomRight" :offsetX="5" :offsetY="5">
101
- <view class="avator"></view>
102
- </ste-badge>
120
+ <template>
121
+ <ste-badge content="1" :offsetX="5" :offsetY="5">
122
+ <view class="avator"></view>
123
+ </ste-badge>
124
+ <ste-badge content="1" position="topLeft" :offsetX="5" :offsetY="5">
125
+ <view class="avator"></view>
126
+ </ste-badge>
127
+ <ste-badge content="1" position="bottomLeft" :offsetX="5" :offsetY="5">
128
+ <view class="avator"></view>
129
+ </ste-badge>
130
+ <ste-badge content="1" position="bottomRight" :offsetX="5" :offsetY="5">
131
+ <view class="avator"></view>
132
+ </ste-badge>
133
+ </template>
134
+ <style>
135
+ .avator {
136
+ height: 80rpx;
137
+ width: 80rpx;
138
+ border-radius: 8rpx;
139
+ background-color: #f2f3f5;
140
+ }
141
+ </style>
103
142
  ```
104
143
 
105
144
  #### 为0时是否显示徽标
@@ -107,9 +146,19 @@
107
146
  当`content`为`Number`类型时并且值等于`0`时,默认不会显示,如果`showZero`为`true`,则会显示
108
147
 
109
148
  ```html
110
- <ste-badge :content="0" showZero>
111
- <view class="avator"></view>
112
- </ste-badge>
149
+ <template>
150
+ <ste-badge :content="0" showZero>
151
+ <view class="avator"></view>
152
+ </ste-badge>
153
+ </template>
154
+ <style>
155
+ .avator {
156
+ height: 80rpx;
157
+ width: 80rpx;
158
+ border-radius: 8rpx;
159
+ background-color: #f2f3f5;
160
+ }
161
+ </style>
113
162
  ```
114
163
 
115
164
  #### 最大值
@@ -117,12 +166,22 @@
117
166
  当`content`为`Number`类型时并且值大于`max`时,会显示`{{max}}+`,`max`默认值为`99`
118
167
 
119
168
  ```html
120
- <ste-badge :content="100">
121
- <view class="avator"></view>
122
- </ste-badge>
123
- <ste-badge :content="99">
124
- <view class="avator"></view>
125
- </ste-badge>
169
+ <template>
170
+ <ste-badge :content="100">
171
+ <view class="avator"></view>
172
+ </ste-badge>
173
+ <ste-badge :content="99">
174
+ <view class="avator"></view>
175
+ </ste-badge>
176
+ </template>
177
+ <style>
178
+ .avator {
179
+ height: 80rpx;
180
+ width: 80rpx;
181
+ border-radius: 8rpx;
182
+ background-color: #f2f3f5;
183
+ }
184
+ </style>
126
185
  ```
127
186
 
128
187
  #### 自定义内容
@@ -130,18 +189,28 @@
130
189
  通过`content`插槽,自定义徽标的内容
131
190
 
132
191
  ```html
133
- <ste-badge>
134
- <template #content>
135
- <ste-icon code="&#xe676;" size="18"></ste-icon>
136
- </template>
137
- <view class="avator"></view>
138
- </ste-badge>
139
- <ste-badge>
140
- <template #content>
141
- <ste-icon code="&#xe67b;" size="12"></ste-icon>
142
- </template>
143
- <view class="avator"></view>
144
- </ste-badge>
192
+ <template>
193
+ <ste-badge>
194
+ <template #content>
195
+ <ste-icon code="&#xe676;" size="18"></ste-icon>
196
+ </template>
197
+ <view class="avator"></view>
198
+ </ste-badge>
199
+ <ste-badge>
200
+ <template #content>
201
+ <ste-icon code="&#xe67b;" size="12"></ste-icon>
202
+ </template>
203
+ <view class="avator"></view>
204
+ </ste-badge>
205
+ </template>
206
+ <style>
207
+ .avator {
208
+ height: 80rpx;
209
+ width: 80rpx;
210
+ border-radius: 8rpx;
211
+ background-color: #f2f3f5;
212
+ }
213
+ </style>
145
214
  ```
146
215
 
147
216
  ---$
@@ -57,7 +57,7 @@ const cmpIsSmall = computed(() => {
57
57
  </script>
58
58
 
59
59
  <template>
60
- <view class="ste-badge-root" :style="[rootStyle as any, { display: isInline ? 'inline-block' : 'block' }]">
60
+ <view class="ste-badge-root" data-test="badge" :style="[rootStyle as any, { display: isInline ? 'inline-block' : 'block' }]">
61
61
  <view class="ste-badge-content" :style="[cmpContentStyle]" :class="'ste-badge-' + position" v-if="showDot || cmpShowContent || $slots.content">
62
62
  <view v-if="showDot" class="dot-box" />
63
63
  <view v-else class="content-box" :class="{ 'no-padding': $slots.content || cmpIsSmall }">
@@ -9,13 +9,17 @@
9
9
  #### 基础使用
10
10
 
11
11
  ```html
12
- <ste-barcode content="123456abc123" />
12
+ <template>
13
+ <ste-barcode content="123456abc123" />
14
+ </template>
13
15
  ```
14
16
 
15
17
  #### 自定义颜色
16
18
 
17
19
  ```html
18
- <ste-barcode content="123456abc123" foreground="#c11" background="#dad" />
20
+ <template>
21
+ <ste-barcode content="123456abc123" foreground="#c11" background="#dad" />
22
+ </template>
19
23
  ```
20
24
 
21
25
  ---$
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import utils from '../../utils/utils';
3
- import { ref, onMounted, watch, getCurrentInstance, type ComponentPublicInstance } from 'vue';
3
+ import { onMounted, watch, getCurrentInstance, type ComponentPublicInstance } from 'vue';
4
4
  import propsData from './props';
5
5
  import { PATTERNS, stringToCode128 } from './encode';
6
6
 
@@ -69,6 +69,10 @@ const patternsToBinary = (codes: number[]) => {
69
69
 
70
70
  // H5环境下的绘制方法
71
71
  const drawBarcodeH5 = (context: UniApp.CanvasContext) => {
72
+ // 测试环境屏蔽uni
73
+ if (process.env.NODE_ENV == 'test') {
74
+ return;
75
+ }
72
76
  if (!props.content) return;
73
77
  // 生成编码数据
74
78
  const codes = stringToCode128(props.content);
@@ -11,10 +11,12 @@
11
11
  通过`mode`设置按钮的大小,默认值是`200`
12
12
 
13
13
  ```html
14
- <ste-button :mode="400">超大按钮</ste-button>
15
- <ste-button :mode="300">大按钮</ste-button>
16
- <ste-button>中按钮</ste-button>
17
- <ste-button :mode="100">小按钮</ste-button>
14
+ <template>
15
+ <ste-button :mode="400">超大按钮</ste-button>
16
+ <ste-button :mode="300">大按钮</ste-button>
17
+ <ste-button>中按钮</ste-button>
18
+ <ste-button :mode="100">小按钮</ste-button>
19
+ </template>
18
20
  ```
19
21
 
20
22
  #### 文本颜色
@@ -22,7 +24,9 @@
22
24
  通过`color`设置字体颜色
23
25
 
24
26
  ```html
25
- <ste-button :color="'#000000'">文本颜色按钮</ste-button>
27
+ <template>
28
+ <ste-button :color="'#000000'">文本颜色按钮</ste-button>
29
+ </template>
26
30
  ```
27
31
 
28
32
  #### 背景
@@ -30,9 +34,11 @@
30
34
  通过`background`设置背景,支持纯颜色、背景图、渐变色
31
35
 
32
36
  ```html
33
- <ste-button background="#ff1e19">按钮</ste-button>
34
- <ste-button background="https://image.whzb.com/chain/StellarUI/image/精选会员瓷片.png">背景图</ste-button>
35
- <ste-button background="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))">渐变色</ste-button>
37
+ <template>
38
+ <ste-button background="#ff1e19">按钮</ste-button>
39
+ <ste-button background="https://image.whzb.com/chain/StellarUI/image/精选会员瓷片.png">背景图</ste-button>
40
+ <ste-button background="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))">渐变色</ste-button>
41
+ </template>
36
42
  ```
37
43
 
38
44
  #### 边框颜色
@@ -40,20 +46,24 @@
40
46
  通过`borderColor`设置边框颜色,默认值是`#ffffff`
41
47
 
42
48
  ```html
43
- <ste-button borderColor="#ff1e19">文本颜色按钮</ste-button>
49
+ <template>
50
+ <ste-button borderColor="#ff1e19">文本颜色按钮</ste-button>
51
+ </template>
44
52
  ```
45
53
 
46
54
  #### 宽度
47
55
 
48
56
  通过`width`设置宽度,默认值是`auto`
49
57
 
50
- - 设置值为`100%`,填满父容器
51
- - 设置具体值时,按具体数值的宽度,单位是rpx
58
+ - 设置值为`100%`,填满父容器
59
+ - 设置具体值时,按具体数值的宽度,单位是rpx
52
60
 
53
61
  ```html
54
- <ste-button width="100%">宽度填满</ste-button>
55
- <ste-button width="500">自定义宽度-500rpx</ste-button>
56
- <ste-button>自适应宽度</ste-button>
62
+ <template>
63
+ <ste-button width="100%">宽度填满</ste-button>
64
+ <ste-button width="500">自定义宽度-500rpx</ste-button>
65
+ <ste-button>自适应宽度</ste-button>
66
+ </template>
57
67
  ```
58
68
 
59
69
  #### 圆角按钮
@@ -61,8 +71,10 @@
61
71
  通过`round`设置按钮是否为圆角,默认值是`true`
62
72
 
63
73
  ```html
64
- <ste-button>圆角按钮</ste-button>
65
- <ste-button :round="false">非圆角按钮</ste-button>
74
+ <template>
75
+ <ste-button>圆角按钮</ste-button>
76
+ <ste-button :round="false">非圆角按钮</ste-button>
77
+ </template>
66
78
  ```
67
79
 
68
80
  #### 禁止按钮
@@ -70,35 +82,43 @@
70
82
  通过`disabled`设置按钮是否禁止,默认值是`false`
71
83
 
72
84
  ```html
73
- <ste-button disabled>禁止按钮</ste-button>
85
+ <template>
86
+ <ste-button disabled>禁止按钮</ste-button>
87
+ </template>
74
88
  ```
75
89
 
76
90
  #### 加载中
77
91
 
78
92
  通过`loading`设置是否加载中,默认值是`false`
79
93
 
80
- - `loading`值是`true`时不允许点击,且按钮内容会变成`加载中......`
94
+ - `loading`值是`true`时不允许点击,且按钮内容会变成`加载中......`
81
95
 
82
96
  ```html
83
- <ste-button loading>按钮</ste-button>
97
+ <template>
98
+ <ste-button loading>按钮</ste-button>
99
+ </template>
84
100
  ```
85
101
 
86
102
  #### 插槽
87
103
 
88
104
  ```html
89
- <ste-button>
90
- <text style="display: inline-block">
91
- <ste-icon code="&#xe68f;" :size="32" :color="'#ffffff'" :marginRight="8"></ste-icon>
92
- </text>
93
- <text>购卡</text>
94
- </ste-button>
95
- <ste-button>提交订单</ste-button>
105
+ <template>
106
+ <ste-button>
107
+ <text style="display: inline-block">
108
+ <ste-icon code="&#xe68f;" :size="32" :color="'#ffffff'" :marginRight="8"></ste-icon>
109
+ </text>
110
+ <text>购卡</text>
111
+ </ste-button>
112
+ <ste-button>提交订单</ste-button>
113
+ </template>
96
114
  ```
97
115
 
98
116
  #### 超长文字
99
117
 
100
118
  ```html
101
- <ste-button width="100%">提交-按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮</ste-button>
119
+ <template>
120
+ <ste-button width="100%">提交-按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮按钮</ste-button>
121
+ </template>
102
122
  ```
103
123
 
104
124
  ---$
@@ -155,6 +155,7 @@ function handleClick(e: any) {
155
155
  @chooseavatar="emits('chooseavatar', $event)"
156
156
  @getAuthorize="emits('getAuthorize', $event)"
157
157
  @followLifestyle="emits('followLifestyle', $event)"
158
+ data-test="button"
158
159
  >
159
160
  <view class="btn-box">
160
161
  <text v-if="loading">加载中.......</text>
@@ -181,6 +182,7 @@ function handleClick(e: any) {
181
182
  @chooseavatar="emits('chooseavatar', $event)"
182
183
  @getAuthorize="emits('getAuthorize', $event)"
183
184
  @followLifestyle="emits('followLifestyle', $event)"
185
+ data-test="button"
184
186
  >
185
187
  <view class="btn-box">
186
188
  <text v-if="loading">加载中.......</text>
@@ -247,29 +249,5 @@ function handleClick(e: any) {
247
249
  opacity: 0.15;
248
250
  }
249
251
  }
250
-
251
- &-100 {
252
- padding: 0 30rpx;
253
- height: 48rpx;
254
- font-size: var(--font-size-24, 24rpx);
255
- }
256
-
257
- &-200 {
258
- padding: 0 40rpx;
259
- height: 68rpx;
260
- font-size: var(--font-size-28, 28rpx);
261
- }
262
-
263
- &-300 {
264
- padding: 0 72rpx;
265
- height: 80rpx;
266
- font-size: var(--font-size-32, 32rpx);
267
- }
268
-
269
- &-400 {
270
- padding: 0 72rpx;
271
- height: 96rpx;
272
- font-size: var(--font-size-36, 36rpx);
273
- }
274
252
  }
275
253
  </style>