2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-14 09:32:25 +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
v-if="!range"
v-bind="$attrs"
ref="calendarPanel"
:type="innerType"
:date-format="innerDateFormat"
:value="currentValue"
@@ -74,6 +75,7 @@
<calendar-panel
style="box-shadow:1px 0 rgba(0, 0, 0, .1)"
v-bind="$attrs"
ref="calendarPanel"
:type="innerType"
:date-format="innerDateFormat"
:value="currentValue[0]"
@@ -487,8 +489,7 @@ export default {
handleChange (event) {
const value = event.target.value
if (this.editable && this.userInput !== null) {
const calendar = this.$children[0]
const checkDate = calendar.isDisabledTime
const checkDate = this.$refs.calendarPanel.isDisabledTime
if (!value) {
this.clearDate()
return