2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-22 14:10:36 +03:00

Merge pull request #234 from acupofspirt/children-array-issue

fix: use refs instead of children array
This commit is contained in:
xiemengxiong
2019-01-22 09:31:08 +08:00
committed by GitHub
+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