adminforth 3.32.0 → 3.32.1
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.
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</div>
|
|
47
47
|
</template>
|
|
48
48
|
<script setup>
|
|
49
|
-
import {ref, computed, onMounted, watch, onBeforeUnmount
|
|
49
|
+
import {ref, computed, onMounted, watch, onBeforeUnmount} from 'vue';
|
|
50
50
|
import dayjs from 'dayjs';
|
|
51
51
|
import utc from 'dayjs/plugin/utc';
|
|
52
52
|
|
|
@@ -89,6 +89,8 @@ const startTime = ref('');
|
|
|
89
89
|
|
|
90
90
|
const datepickerObject = ref('')
|
|
91
91
|
|
|
92
|
+
let datepickerReady;
|
|
93
|
+
|
|
92
94
|
const start = computed(() => {
|
|
93
95
|
if (props.column?.type === 'time') {
|
|
94
96
|
return formatTime(startTime.value);
|
|
@@ -118,14 +120,15 @@ async function updateFromProps() {
|
|
|
118
120
|
} else if (props.column.type === 'time') {
|
|
119
121
|
startTime.value = props.valueStart;
|
|
120
122
|
} else {
|
|
121
|
-
//
|
|
122
|
-
await
|
|
123
|
+
// datepicker is created only after its lazy-loaded chunk resolves
|
|
124
|
+
await datepickerReady;
|
|
123
125
|
datepickerObject.value.setDate(dayjs(props.valueStart).format('DD MMM YYYY'));
|
|
124
126
|
startTime.value = dayjs(props.valueStart).format('HH:mm:ss')
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
onMounted(() => {
|
|
131
|
+
datepickerReady = initDatepickers();
|
|
129
132
|
updateFromProps();
|
|
130
133
|
|
|
131
134
|
watch(() => [props.valueStart], (value) => {
|
|
@@ -183,10 +186,6 @@ const toggleTimeInputs = () => {
|
|
|
183
186
|
showTimeInputs.value = !showTimeInputs.value
|
|
184
187
|
}
|
|
185
188
|
|
|
186
|
-
onMounted(() => {
|
|
187
|
-
initDatepickers();
|
|
188
|
-
});
|
|
189
|
-
|
|
190
189
|
onBeforeUnmount(() => {
|
|
191
190
|
removeChangeDateListener();
|
|
192
191
|
destroyDatepickerElement();
|