Skip to content

Commit 479fb8f

Browse files
authored
Merge pull request #234 from acupofspirt/children-array-issue
fix: use refs instead of children array
2 parents 0465f2e + f43e3a3 commit 479fb8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<calendar-panel
6464
v-if="!range"
6565
v-bind="$attrs"
66+
ref="calendarPanel"
6667
:type="innerType"
6768
:date-format="innerDateFormat"
6869
:value="currentValue"
@@ -74,6 +75,7 @@
7475
<calendar-panel
7576
style="box-shadow:1px 0 rgba(0, 0, 0, .1)"
7677
v-bind="$attrs"
78+
ref="calendarPanel"
7779
:type="innerType"
7880
:date-format="innerDateFormat"
7981
:value="currentValue[0]"
@@ -487,8 +489,7 @@ export default {
487489
handleChange (event) {
488490
const value = event.target.value
489491
if (this.editable && this.userInput !== null) {
490-
const calendar = this.$children[0]
491-
const checkDate = calendar.isDisabledTime
492+
const checkDate = this.$refs.calendarPanel.isDisabledTime
492493
if (!value) {
493494
this.clearDate()
494495
return

0 commit comments

Comments
 (0)