papayaui 0.3.7 → 0.3.8
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.
|
@@ -172,11 +172,19 @@ const emitRangeConfirm = (start?: Date, end?: Date) => {
|
|
|
172
172
|
|
|
173
173
|
const openStart = () => {
|
|
174
174
|
if (!canOpenPopup.value) return
|
|
175
|
+
// 没有已选值时,用 defaultStartDate 或当前时间作为选择器初始时间
|
|
176
|
+
if (!innerStart.value) {
|
|
177
|
+
innerStart.value = props.defaultStartDate || new Date()
|
|
178
|
+
}
|
|
175
179
|
showStartPopup.value = true
|
|
176
180
|
}
|
|
177
181
|
|
|
178
182
|
const openEnd = () => {
|
|
179
183
|
if (!canOpenPopup.value) return
|
|
184
|
+
// 没有已选值时,用 defaultEndDate 或当前时间作为选择器初始时间
|
|
185
|
+
if (!innerEnd.value) {
|
|
186
|
+
innerEnd.value = props.defaultEndDate || new Date()
|
|
187
|
+
}
|
|
180
188
|
showEndPopup.value = true
|
|
181
189
|
}
|
|
182
190
|
|
|
@@ -211,6 +219,8 @@ const onStartConfirm = (val: Date) => {
|
|
|
211
219
|
}
|
|
212
220
|
|
|
213
221
|
const onStartCancel = () => {
|
|
222
|
+
// 取消时恢复内部值,防止临时默认值影响下次打开
|
|
223
|
+
innerStart.value = props.start
|
|
214
224
|
showStartPopup.value = false
|
|
215
225
|
emit('cancel')
|
|
216
226
|
}
|
|
@@ -235,6 +245,8 @@ const onEndChange = (val: Date) => {
|
|
|
235
245
|
}
|
|
236
246
|
|
|
237
247
|
const onEndCancel = () => {
|
|
248
|
+
// 取消时恢复内部值,防止临时默认值影响下次打开
|
|
249
|
+
innerEnd.value = props.end
|
|
238
250
|
showEndPopup.value = false
|
|
239
251
|
emit('cancel')
|
|
240
252
|
}
|