uview-plus 3.3.8 → 3.3.10
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/changelog.md +34 -0
- package/components/u-action-sheet/u-action-sheet.vue +4 -1
- package/components/u-album/props.js +10 -0
- package/components/u-album/u-album.vue +31 -23
- package/components/u-calendar/month.vue +1 -0
- package/components/u-datetime-picker/u-datetime-picker.vue +1 -0
- package/components/u-form/u-form.vue +70 -41
- package/components/u-grid/u-grid.vue +1 -1
- package/components/u-grid-item/u-grid-item.vue +5 -0
- package/components/u-index-list/u-index-list.vue +16 -7
- package/components/u-input/u-input.vue +3 -2
- package/components/u-loading-page/props.js +6 -1
- package/components/u-loading-page/u-loading-page.vue +3 -0
- package/components/u-modal/props.js +6 -1
- package/components/u-modal/u-modal.vue +3 -1
- package/components/u-slider/u-slider.vue +1 -0
- package/components/u-steps/u-steps.vue +7 -0
- package/components/u-steps-item/props.js +6 -1
- package/components/u-steps-item/u-steps-item.vue +15 -3
- package/components/u-tabbar-item/u-tabbar-item.vue +1 -2
- package/components/u-waterfall/u-waterfall.vue +2 -0
- package/libs/config/props/album.js +3 -1
- package/libs/config/props/input.js +1 -1
- package/libs/config/props/loadingPage.js +2 -1
- package/libs/config/props/modal.js +2 -1
- package/libs/mixin/mixin.js +9 -2
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
## 3.3.10(2024-08-02)
|
|
2
|
+
fix: 修复index-list偶发的滑动最后一个索引报错top不存在
|
|
3
|
+
|
|
4
|
+
fix: 修复gird在QQ、抖音小程序下布局
|
|
5
|
+
|
|
6
|
+
feat: 优化step支持自定义样式prop
|
|
7
|
+
|
|
8
|
+
feat: action-sheet组件支持v-model:show双向绑定
|
|
9
|
+
|
|
10
|
+
fix: 小程序下steps和grid都统一采用grid布局
|
|
11
|
+
|
|
12
|
+
fix: 修复支付宝小程序下input类型为数字时双向绑定失效
|
|
13
|
+
|
|
14
|
+
feat : form 表单 validate 校验不通过后 error增加字段prop信息 #304
|
|
15
|
+
|
|
16
|
+
fix: form组件异步校异常验问题 #393
|
|
17
|
+
|
|
18
|
+
## 3.3.9(2024-08-01)
|
|
19
|
+
fix: 优化获取nvue元素
|
|
20
|
+
|
|
21
|
+
feat: modal新增contentTextAlign设置文案对齐方式
|
|
22
|
+
|
|
23
|
+
fix: 修复NVUE下tabbar文字不显示 #458
|
|
24
|
+
|
|
25
|
+
feat: loading-page增加zIndex属性
|
|
26
|
+
|
|
27
|
+
fix: 相册在宽度较小时换行问题
|
|
28
|
+
|
|
29
|
+
feat: album相册增加自适应自动换行模式
|
|
30
|
+
|
|
31
|
+
feat: album相册增加图片尺寸单位prop
|
|
32
|
+
|
|
33
|
+
fix: 修复calendar日历月份居中
|
|
34
|
+
|
|
1
35
|
## 3.3.8(2024-07-31)
|
|
2
36
|
feat: slider支持进度条任意位置触发按钮拖动
|
|
3
37
|
|
|
@@ -166,16 +166,18 @@
|
|
|
166
166
|
}
|
|
167
167
|
},
|
|
168
168
|
},
|
|
169
|
-
emits: ["close", "select"],
|
|
169
|
+
emits: ["close", "select", "update:show"],
|
|
170
170
|
methods: {
|
|
171
171
|
closeHandler() {
|
|
172
172
|
// 允许点击遮罩关闭时,才发出close事件
|
|
173
173
|
if(this.closeOnClickOverlay) {
|
|
174
|
+
this.$emit('update:show')
|
|
174
175
|
this.$emit('close')
|
|
175
176
|
}
|
|
176
177
|
},
|
|
177
178
|
// 点击取消按钮
|
|
178
179
|
cancel() {
|
|
180
|
+
this.$emit('update:show')
|
|
179
181
|
this.$emit('close')
|
|
180
182
|
},
|
|
181
183
|
selectHandler(index) {
|
|
@@ -183,6 +185,7 @@
|
|
|
183
185
|
if (item && !item.disabled && !item.loading) {
|
|
184
186
|
this.$emit('select', item)
|
|
185
187
|
if (this.closeOnClickAction) {
|
|
188
|
+
this.$emit('update:show')
|
|
186
189
|
this.$emit('close')
|
|
187
190
|
}
|
|
188
191
|
}
|
|
@@ -66,6 +66,16 @@ export const props = defineMixin({
|
|
|
66
66
|
radius: {
|
|
67
67
|
type: [String, Number],
|
|
68
68
|
default: () => defProps.image.radius
|
|
69
|
+
},
|
|
70
|
+
// 自适应换行
|
|
71
|
+
autoWrap: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: () => defProps.album.autoWrap
|
|
74
|
+
},
|
|
75
|
+
// 单位
|
|
76
|
+
unit: {
|
|
77
|
+
type: [String],
|
|
78
|
+
default: () => defProps.album.unit
|
|
69
79
|
}
|
|
70
80
|
}
|
|
71
81
|
})
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
v-for="(arr, index) in showUrls"
|
|
7
7
|
:forComputedUse="albumWidth"
|
|
8
8
|
:key="index"
|
|
9
|
+
:style="{flexWrap: autoWrap ? 'wrap' : 'nowrap'}"
|
|
9
10
|
>
|
|
10
11
|
<view
|
|
11
12
|
class="u-album__row__wrapper"
|
|
@@ -85,6 +86,8 @@ const dom = uni.requireNativePlugin('dom')
|
|
|
85
86
|
* @property {Boolean} showMore 超出maxCount时是否显示查看更多的提示 (默认 true )
|
|
86
87
|
* @property {String} shape 图片形状,circle-圆形,square-方形 (默认 'square' )
|
|
87
88
|
* @property {String | Number} radius 圆角值,单位任意,如果为数值,则为px单位 (默认 0 )
|
|
89
|
+
* @property {Boolean} autoWrap 自适应换行模式,不受rowCount限制,图片会自动换行 (默认 false )
|
|
90
|
+
* @property {String} unit 图片单位 (默认 px )
|
|
88
91
|
* @event {Function} albumWidth 某些特殊的情况下,需要让文字与相册的宽度相等,这里事件的形式对外发送 (回调参数 width )
|
|
89
92
|
* @example <u-album :urls="urls2" @albumWidth="width => albumWidth = width" multipleSize="68" ></u-album>
|
|
90
93
|
*/
|
|
@@ -124,42 +127,48 @@ export default {
|
|
|
124
127
|
marginBottom: addUnit(space)
|
|
125
128
|
}
|
|
126
129
|
// 如果为最后一行,则每个图片都无需下边框
|
|
127
|
-
if (index1 === rowLen) style.marginBottom = 0
|
|
130
|
+
if (index1 === rowLen && !this.autoWrap) style.marginBottom = 0
|
|
128
131
|
// 每行的最右边一张和总长度的最后一张无需右边框
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
if (!this.autoWrap) {
|
|
133
|
+
if (
|
|
134
|
+
index2 === rowCount ||
|
|
135
|
+
(index1 === rowLen &&
|
|
136
|
+
index2 === this.showUrls[index1 - 1].length)
|
|
137
|
+
)
|
|
138
|
+
style.marginRight = 0
|
|
139
|
+
}
|
|
135
140
|
return style
|
|
136
141
|
}
|
|
137
142
|
},
|
|
138
143
|
// 将数组划分为二维数组
|
|
139
144
|
showUrls() {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
if (this.autoWrap) {
|
|
146
|
+
return [ this.urls.slice(0, this.maxCount) ];
|
|
147
|
+
} else {
|
|
148
|
+
const arr = []
|
|
149
|
+
this.urls.map((item, index) => {
|
|
150
|
+
// 限制最大展示数量
|
|
151
|
+
if (index + 1 <= this.maxCount) {
|
|
152
|
+
// 计算该元素为第几个素组内
|
|
153
|
+
const itemIndex = Math.floor(index / this.rowCount)
|
|
154
|
+
// 判断对应的索引是否存在
|
|
155
|
+
if (!arr[itemIndex]) {
|
|
156
|
+
arr[itemIndex] = []
|
|
157
|
+
}
|
|
158
|
+
arr[itemIndex].push(item)
|
|
149
159
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
return arr
|
|
160
|
+
})
|
|
161
|
+
return arr
|
|
162
|
+
}
|
|
154
163
|
},
|
|
155
164
|
imageWidth() {
|
|
156
165
|
return addUnit(
|
|
157
|
-
this.urls.length === 1 ? this.singleWidth : this.multipleSize
|
|
166
|
+
this.urls.length === 1 ? this.singleWidth : this.multipleSize, this.unit
|
|
158
167
|
)
|
|
159
168
|
},
|
|
160
169
|
imageHeight() {
|
|
161
170
|
return addUnit(
|
|
162
|
-
this.urls.length === 1 ? this.singleHeight : this.multipleSize
|
|
171
|
+
this.urls.length === 1 ? this.singleHeight : this.multipleSize, this.unit
|
|
163
172
|
)
|
|
164
173
|
},
|
|
165
174
|
// 此变量无实际用途,仅仅是为了利用computed特性,让其在urls长度等变化时,重新计算图片的宽度
|
|
@@ -248,7 +257,6 @@ export default {
|
|
|
248
257
|
|
|
249
258
|
&__row {
|
|
250
259
|
@include flex(row);
|
|
251
|
-
flex-wrap: wrap;
|
|
252
260
|
|
|
253
261
|
&__wrapper {
|
|
254
262
|
position: relative;
|
|
@@ -134,54 +134,82 @@
|
|
|
134
134
|
// 如果为字符串,转为数组
|
|
135
135
|
value = [].concat(value);
|
|
136
136
|
// 历遍children所有子form-item
|
|
137
|
-
this.children.map(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
137
|
+
let promises = this.children.map(child => {
|
|
138
|
+
return new Promise((resolve, reject) => {
|
|
139
|
+
// 用于存放form-item的错误信息
|
|
140
|
+
const childErrors = [];
|
|
141
|
+
if (value.includes(child.prop)) {
|
|
142
|
+
// 获取对应的属性,通过类似'a.b.c'的形式
|
|
143
|
+
const propertyVal = getProperty(
|
|
144
|
+
this.model,
|
|
145
|
+
child.prop
|
|
146
|
+
);
|
|
147
|
+
// 属性链数组
|
|
148
|
+
const propertyChain = child.prop.split(".");
|
|
149
|
+
const propertyName =
|
|
150
|
+
propertyChain[propertyChain.length - 1];
|
|
150
151
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
const rule = this.formRules[child.rule || child.prop];
|
|
153
|
+
// 如果不存在对应的规则,直接返回,否则校验器会报错
|
|
154
|
+
if (!rule) {
|
|
155
|
+
resolve()
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
// rule规则可为数组形式,也可为对象形式,此处拼接成为数组
|
|
159
|
+
const rules = [].concat(rule);
|
|
156
160
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
// 对rules数组进行校验
|
|
162
|
+
if (!rules.length) {
|
|
163
|
+
resolve()
|
|
164
|
+
}
|
|
165
|
+
for (let i = 0; i < rules.length; i++) {
|
|
166
|
+
const ruleItem = rules[i];
|
|
167
|
+
// 将u-form-item的触发器转为数组形式
|
|
168
|
+
const trigger = [].concat(ruleItem?.trigger);
|
|
169
|
+
// 如果是有传入触发事件,但是此form-item却没有配置此触发器的话,不执行校验操作
|
|
170
|
+
if (event && !trigger.includes(event)) {
|
|
171
|
+
resolve()
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
// 实例化校验对象,传入构造规则
|
|
175
|
+
const validator = new Schema({
|
|
176
|
+
[propertyName]: ruleItem,
|
|
177
|
+
});
|
|
178
|
+
validator.validate({
|
|
169
179
|
[propertyName]: propertyVal,
|
|
170
180
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
181
|
+
(errors, fields) => {
|
|
182
|
+
if (test.array(errors)) {
|
|
183
|
+
errors.forEach(element => {
|
|
184
|
+
element.prop = child.prop;
|
|
185
|
+
});
|
|
186
|
+
errorsRes.push(...errors);
|
|
187
|
+
childErrors.push(...errors);
|
|
188
|
+
}
|
|
189
|
+
child.message =
|
|
190
|
+
childErrors[0]?.message ? childErrors[0].message : null;
|
|
191
|
+
|
|
192
|
+
if (i == (rules.length - 1)) {
|
|
193
|
+
resolve(errorsRes)
|
|
194
|
+
}
|
|
175
195
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
)
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
resolve({})
|
|
180
200
|
}
|
|
181
|
-
}
|
|
201
|
+
});
|
|
182
202
|
});
|
|
183
|
-
|
|
184
|
-
|
|
203
|
+
|
|
204
|
+
// 使用Promise.all来等待所有Promise完成
|
|
205
|
+
Promise.all(promises)
|
|
206
|
+
.then(results => {
|
|
207
|
+
// 执行回调函数
|
|
208
|
+
typeof callback === "function" && callback(errorsRes);
|
|
209
|
+
})
|
|
210
|
+
.catch(error => {
|
|
211
|
+
console.error('An error occurred:', error);
|
|
212
|
+
});
|
|
185
213
|
});
|
|
186
214
|
},
|
|
187
215
|
// 校验全部数据
|
|
@@ -198,6 +226,7 @@
|
|
|
198
226
|
const formItemProps = this.children.map(
|
|
199
227
|
(item) => item.prop
|
|
200
228
|
);
|
|
229
|
+
// console.log(formItemProps)
|
|
201
230
|
this.validateField(formItemProps, (errors) => {
|
|
202
231
|
if(errors.length) {
|
|
203
232
|
// 如果错误提示方式为toast,则进行提示
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
align-items: center;
|
|
106
106
|
// 在uni-app中应尽量避免使用flex布局以外的方式,因为nvue/uvue等方案都支持flex布局
|
|
107
107
|
// 这里使用grid布局使用为目前20240409uni-app在抖音小程序开启virtualHost时有bug,存在事件失效问题。
|
|
108
|
-
/* #ifdef MP
|
|
108
|
+
/* #ifdef MP */
|
|
109
109
|
display: grid;
|
|
110
110
|
grid-template-columns: repeat(v-bind(col), 1fr);
|
|
111
111
|
/* #endif */
|
|
@@ -361,16 +361,16 @@
|
|
|
361
361
|
// pageY += sys().windowTop
|
|
362
362
|
// #endif
|
|
363
363
|
// 对第一和最后一个字母做边界处理,因为用户可能在字母列表上触摸到两端的尽头后依然继续滑动
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
console.log('top1', top)
|
|
365
|
+
console.log('height', height)
|
|
366
366
|
top = top - (height / 2) // 减去transfrom的translateY值导致的高度
|
|
367
367
|
pageY = pageY - this.topOffset
|
|
368
368
|
// if (this.safeBottomFix) {
|
|
369
369
|
// pageY = pageY + 34
|
|
370
370
|
// }
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
371
|
+
console.log('topOffset', this.topOffset)
|
|
372
|
+
console.log('pageY', pageY)
|
|
373
|
+
console.log('top2', top)
|
|
374
374
|
if (pageY < top) {
|
|
375
375
|
index = 0
|
|
376
376
|
} else if (pageY >= top + height) {
|
|
@@ -418,7 +418,9 @@
|
|
|
418
418
|
return child
|
|
419
419
|
})
|
|
420
420
|
// console.log('this.children[currentIndex].top', children[currentIndex].top)
|
|
421
|
-
|
|
421
|
+
if (children[currentIndex]?.top) {
|
|
422
|
+
this.scrollTop = children[currentIndex].top - getPx(customNavHeight)
|
|
423
|
+
}
|
|
422
424
|
// #endif
|
|
423
425
|
|
|
424
426
|
// #ifdef APP-NVUE
|
|
@@ -441,7 +443,14 @@
|
|
|
441
443
|
// #endif
|
|
442
444
|
|
|
443
445
|
// #ifdef APP-NVUE
|
|
444
|
-
|
|
446
|
+
let headerRef = this.$refs.header
|
|
447
|
+
if (!headerRef) {
|
|
448
|
+
resolve({
|
|
449
|
+
width: 0,
|
|
450
|
+
height: 0
|
|
451
|
+
})
|
|
452
|
+
}
|
|
453
|
+
dom.getComponentRect(headerRef, res => {
|
|
445
454
|
resolve(res.size)
|
|
446
455
|
})
|
|
447
456
|
// #endif
|
|
@@ -91,7 +91,7 @@ import { addStyle, addUnit, deepMerge, formValidate, $parent, sleep, os } from '
|
|
|
91
91
|
* @property {String} disabledColor 禁用状态时的背景色( 默认 '#f5f7fa' )
|
|
92
92
|
* @property {Boolean} clearable 是否显示清除控件 ( 默认 false )
|
|
93
93
|
* @property {Boolean} password 是否密码类型 ( 默认 false )
|
|
94
|
-
* @property {
|
|
94
|
+
* @property {Number} maxlength 最大输入长度,设置为 -1 的时候不限制最大长度 ( 默认 -1 )
|
|
95
95
|
* @property {String} placeholder 输入框为空时的占位符
|
|
96
96
|
* @property {String} placeholderClass 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ ( 默认 'input-placeholder' )
|
|
97
97
|
* @property {String | Object} placeholderStyle 指定placeholder的样式,字符串/对象形式,如"color: red;"
|
|
@@ -102,7 +102,7 @@ import { addStyle, addUnit, deepMerge, formValidate, $parent, sleep, os } from '
|
|
|
102
102
|
* @property {Boolean} focus 自动获取焦点,在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点 ( 默认 false )
|
|
103
103
|
* @property {Boolean} autoBlur 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效 ( 默认 false )
|
|
104
104
|
* @property {Boolean} disableDefaultPadding 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效 ( 默认 false )
|
|
105
|
-
* @property {String | Number} cursor 指定focus时光标的位置( 默认
|
|
105
|
+
* @property {String | Number} cursor 指定focus时光标的位置( 默认 140 )
|
|
106
106
|
* @property {String | Number} cursorSpacing 输入框聚焦时底部与键盘的距离 ( 默认 30 )
|
|
107
107
|
* @property {String | Number} selectionStart 光标起始位置,自动聚集时有效,需与selection-end搭配使用 ( 默认 -1 )
|
|
108
108
|
* @property {String | Number} selectionEnd 光标结束位置,自动聚集时有效,需与selection-start搭配使用 ( 默认 -1 )
|
|
@@ -234,6 +234,7 @@ export default {
|
|
|
234
234
|
onInput(e) {
|
|
235
235
|
let { value = "" } = e.detail || {};
|
|
236
236
|
// 为了避免props的单向数据流特性,需要先将innerValue值设置为当前值,再在$nextTick中重新赋予设置后的值才有效
|
|
237
|
+
// console.log('onInput', value, this.innerValue)
|
|
237
238
|
this.innerValue = value;
|
|
238
239
|
this.$nextTick(() => {
|
|
239
240
|
let formatValue = this.innerFormatter(value);
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
bottom: 0,
|
|
10
10
|
backgroundColor: bgColor,
|
|
11
11
|
display: 'flex',
|
|
12
|
+
zIndex: zIndex,
|
|
13
|
+
...customStyle
|
|
12
14
|
}"
|
|
13
15
|
>
|
|
14
16
|
<view class="u-loading-page">
|
|
@@ -64,6 +66,7 @@ import { addUnit } from '../../libs/function/index';
|
|
|
64
66
|
* @property {String | Number} fontSize 文字大小 (默认 19 )
|
|
65
67
|
* @property {String | Number} iconSize 图标大小 (默认 28 )
|
|
66
68
|
* @property {String} loadingColor 加载中图标的颜色,只能rgb或者十六进制颜色值 (默认 '#C8C8C8' )
|
|
69
|
+
* @property {Number} zIndex z-index层级 (默认10 )
|
|
67
70
|
* @property {Object} customStyle 自定义样式
|
|
68
71
|
* @example <u-loading mode="circle"></u-loading>
|
|
69
72
|
*/
|
|
@@ -81,6 +81,11 @@ export const props = defineMixin({
|
|
|
81
81
|
confirmButtonShape: {
|
|
82
82
|
type: String,
|
|
83
83
|
default: () => defProps.modal.confirmButtonShape
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
|
+
// 文案对齐方式
|
|
86
|
+
contentTextAlign: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: () => defProps.modal.contentTextAlign
|
|
89
|
+
},
|
|
85
90
|
}
|
|
86
91
|
})
|
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
},
|
|
62
62
|
created() {
|
|
63
63
|
this.children = []
|
|
64
|
+
},
|
|
65
|
+
options: {
|
|
66
|
+
virtualHost: false
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
</script>
|
|
@@ -78,6 +81,10 @@
|
|
|
78
81
|
&--row {
|
|
79
82
|
flex-direction: row;
|
|
80
83
|
flex: 1;
|
|
84
|
+
/* #ifdef MP */
|
|
85
|
+
display: grid;
|
|
86
|
+
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
|
87
|
+
/* #endif */
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
</style>
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<view class="u-steps-item__line" v-if="index + 1 < childLength"
|
|
4
4
|
:class="[`u-steps-item__line--${parentData.direction}`]" :style="[lineStyle]"></view>
|
|
5
5
|
<view class="u-steps-item__wrapper"
|
|
6
|
-
:class="[`u-steps-item__wrapper--${parentData.direction}`, parentData.dot && `u-steps-item__wrapper--${parentData.direction}--dot`]"
|
|
6
|
+
:class="[`u-steps-item__wrapper--${parentData.direction}`, parentData.dot && `u-steps-item__wrapper--${parentData.direction}--dot`]"
|
|
7
|
+
:style="[itemStyle]">
|
|
7
8
|
<slot name="icon">
|
|
8
9
|
<view class="u-steps-item__wrapper__dot" v-if="parentData.dot" :style="{
|
|
9
10
|
backgroundColor: statusColor
|
|
@@ -95,6 +96,11 @@
|
|
|
95
96
|
created() {
|
|
96
97
|
this.init()
|
|
97
98
|
},
|
|
99
|
+
// #ifdef MP-TOUTIAO
|
|
100
|
+
options: {
|
|
101
|
+
virtualHost: false
|
|
102
|
+
},
|
|
103
|
+
// #endif
|
|
98
104
|
computed: {
|
|
99
105
|
lineStyle() {
|
|
100
106
|
const style = {}
|
|
@@ -111,6 +117,11 @@
|
|
|
111
117
|
.current ? this.parentData.activeColor : this.parentData.inactiveColor
|
|
112
118
|
return style
|
|
113
119
|
},
|
|
120
|
+
itemStyle() {
|
|
121
|
+
return {
|
|
122
|
+
...this.itemStyle
|
|
123
|
+
}
|
|
124
|
+
},
|
|
114
125
|
statusClass() {
|
|
115
126
|
const {
|
|
116
127
|
index,
|
|
@@ -231,10 +242,11 @@
|
|
|
231
242
|
align-items: center;
|
|
232
243
|
position: relative;
|
|
233
244
|
background-color: #fff;
|
|
245
|
+
border-radius: 50px;
|
|
234
246
|
|
|
235
247
|
&--column {
|
|
236
248
|
width: 20px;
|
|
237
|
-
height:
|
|
249
|
+
height: 20px;
|
|
238
250
|
|
|
239
251
|
&--dot {
|
|
240
252
|
height: 20px;
|
|
@@ -243,7 +255,7 @@
|
|
|
243
255
|
}
|
|
244
256
|
|
|
245
257
|
&--row {
|
|
246
|
-
width:
|
|
258
|
+
width: 20px;
|
|
247
259
|
height: 20px;
|
|
248
260
|
|
|
249
261
|
&--dot {
|
package/libs/mixin/mixin.js
CHANGED
|
@@ -130,8 +130,15 @@ export const mixin = defineMixin({
|
|
|
130
130
|
let selectorNvue = selector.substring(1) // 去掉开头的#或者.
|
|
131
131
|
let selectorRef = this.$refs[selectorNvue]
|
|
132
132
|
if (!selectorRef) {
|
|
133
|
-
console.log('不存在元素,请检查是否设置了ref属性' + selectorNvue + '。')
|
|
134
|
-
resolve({
|
|
133
|
+
// console.log('不存在元素,请检查是否设置了ref属性' + selectorNvue + '。')
|
|
134
|
+
resolve({
|
|
135
|
+
with: 0,
|
|
136
|
+
height: 0,
|
|
137
|
+
left: 0,
|
|
138
|
+
right: 0,
|
|
139
|
+
top: 0,
|
|
140
|
+
bottom: 0
|
|
141
|
+
})
|
|
135
142
|
}
|
|
136
143
|
dom.getComponentRect(selectorRef, res => {
|
|
137
144
|
// console.log(res)
|