sadais-piui 1.2.4-beta3 → 1.2.4-beta4
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.
|
@@ -299,8 +299,10 @@ export default {
|
|
|
299
299
|
}
|
|
300
300
|
},
|
|
301
301
|
watch: {
|
|
302
|
-
value(
|
|
303
|
-
|
|
302
|
+
value(newVal, oldVal) {
|
|
303
|
+
if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
|
|
304
|
+
this.init()
|
|
305
|
+
}
|
|
304
306
|
}
|
|
305
307
|
},
|
|
306
308
|
created() {
|
|
@@ -311,7 +313,6 @@ export default {
|
|
|
311
313
|
if (this.type === 'date') return true
|
|
312
314
|
if (this.type === 'range' && this.$pi.lang.isArray(this.value) && this.value.length === 2)
|
|
313
315
|
return true
|
|
314
|
-
console.error(TAG, 'value 参数不合法,请检查')
|
|
315
316
|
return false
|
|
316
317
|
},
|
|
317
318
|
init() {
|
|
@@ -324,11 +325,11 @@ export default {
|
|
|
324
325
|
this.year = nowDate.year
|
|
325
326
|
this.month = nowDate.month
|
|
326
327
|
}
|
|
327
|
-
this.
|
|
328
|
+
this.handleChange([nowDate, endDate])
|
|
328
329
|
} else {
|
|
329
330
|
this.year = nowDate.year
|
|
330
331
|
this.month = nowDate.month
|
|
331
|
-
this.
|
|
332
|
+
this.handleChange(nowDate)
|
|
332
333
|
}
|
|
333
334
|
},
|
|
334
335
|
isSameDay(day1, day2) {
|
|
@@ -357,7 +358,7 @@ export default {
|
|
|
357
358
|
// 处理范围选择方式
|
|
358
359
|
if (this.calendarValue.length === 2) {
|
|
359
360
|
// 如果选了两项,则重新开始选择范围
|
|
360
|
-
this.
|
|
361
|
+
this.handleChange([date])
|
|
361
362
|
} else {
|
|
362
363
|
// 如果第二项选择的和第一项一样,不做处理
|
|
363
364
|
const isSameDay = this.isSameDay(this.calendarValue[0], date)
|
|
@@ -393,7 +394,7 @@ export default {
|
|
|
393
394
|
this.year = this.now.year
|
|
394
395
|
this.month = this.now.month
|
|
395
396
|
if (this.type === 'date') {
|
|
396
|
-
this.
|
|
397
|
+
this.handleChange(this.now)
|
|
397
398
|
}
|
|
398
399
|
},
|
|
399
400
|
handleChange(calendarValue) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: zhangzhenfei
|
|
3
3
|
* @Date: 2021-08-13 11:31:57
|
|
4
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditTime: 2022-04-07 11:51:44
|
|
5
5
|
* @LastEditors: zhangzhenfei
|
|
6
6
|
* @Description: 图片上传组件
|
|
7
7
|
* @FilePath: /piui-awesome/src/piui/components/pi-upload-img/index.vue
|
|
@@ -340,7 +340,7 @@ export default {
|
|
|
340
340
|
? this.beforeRemove.fn
|
|
341
341
|
: this.beforeRemove
|
|
342
342
|
if (this.$pi.lang.isFunction(beforeRemove)) {
|
|
343
|
-
//
|
|
343
|
+
// 删除之前的钩子, 如果定义了则使用钩子删除文件
|
|
344
344
|
val = await beforeRemove(index)
|
|
345
345
|
} else {
|
|
346
346
|
val = this.isValString ? '' : this.val.filter((_, i) => i !== index)
|