2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-24 09:30:36 +03:00

fix: use refs instead of children array

This commit is contained in:
Maksim Nazarjev
2019-01-22 02:12:28 +03:00
parent 0465f2effb
commit f43e3a3500
+3 -2
View File
@@ -63,6 +63,7 @@
<calendar-panel <calendar-panel
v-if="!range" v-if="!range"
v-bind="$attrs" v-bind="$attrs"
ref="calendarPanel"
:type="innerType" :type="innerType"
:date-format="innerDateFormat" :date-format="innerDateFormat"
:value="currentValue" :value="currentValue"
@@ -74,6 +75,7 @@
<calendar-panel <calendar-panel
style="box-shadow:1px 0 rgba(0, 0, 0, .1)" style="box-shadow:1px 0 rgba(0, 0, 0, .1)"
v-bind="$attrs" v-bind="$attrs"
ref="calendarPanel"
:type="innerType" :type="innerType"
:date-format="innerDateFormat" :date-format="innerDateFormat"
:value="currentValue[0]" :value="currentValue[0]"
@@ -487,8 +489,7 @@ export default {
handleChange (event) { handleChange (event) {
const value = event.target.value const value = event.target.value
if (this.editable && this.userInput !== null) { if (this.editable && this.userInput !== null) {
const calendar = this.$children[0] const checkDate = this.$refs.calendarPanel.isDisabledTime
const checkDate = calendar.isDisabledTime
if (!value) { if (!value) {
this.clearDate() this.clearDate()
return return