vueless 0.0.316 → 0.0.317
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/package.json +1 -1
- package/ui.form-calendar/index.vue +20 -10
- package/web-types.json +1 -1
package/package.json
CHANGED
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
</template>
|
|
141
141
|
|
|
142
142
|
<script setup>
|
|
143
|
-
import { computed,
|
|
143
|
+
import { computed, ref, watch } from "vue";
|
|
144
144
|
import { merge } from "lodash-es";
|
|
145
145
|
|
|
146
146
|
import UButton from "../ui.button";
|
|
@@ -543,16 +543,26 @@ watch(
|
|
|
543
543
|
},
|
|
544
544
|
);
|
|
545
545
|
|
|
546
|
-
|
|
547
|
-
if (selectedDate.value && isTimepickerEnabled.value) {
|
|
548
|
-
hoursRef.value.value = String(selectedDate.value.getHours()).padStart(2, "0");
|
|
549
|
-
minutesRef.value.value = String(selectedDate.value.getMinutes()).padStart(2, "0");
|
|
550
|
-
secondsRef.value.value = String(selectedDate.value.getSeconds()).padStart(2, "0");
|
|
551
|
-
}
|
|
546
|
+
let isInit = false;
|
|
552
547
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
548
|
+
const unwatchInit = watch(
|
|
549
|
+
() => selectedDate.value,
|
|
550
|
+
() => {
|
|
551
|
+
if (isInit) unwatchInit();
|
|
552
|
+
|
|
553
|
+
if (selectedDate.value && isTimepickerEnabled.value) {
|
|
554
|
+
hoursRef.value.value = String(selectedDate.value.getHours()).padStart(2, "0");
|
|
555
|
+
minutesRef.value.value = String(selectedDate.value.getMinutes()).padStart(2, "0");
|
|
556
|
+
secondsRef.value.value = String(selectedDate.value.getSeconds()).padStart(2, "0");
|
|
557
|
+
|
|
558
|
+
emit("formattedDateChange", userFormattedDate.value);
|
|
559
|
+
emit("userDateChange", userFormattedDate.value);
|
|
560
|
+
|
|
561
|
+
isInit = true;
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
{ deep: true },
|
|
565
|
+
);
|
|
556
566
|
|
|
557
567
|
function getCurrentValueType(value) {
|
|
558
568
|
if (props.range && value === null) {
|