From b3126a0c65d05cf1432d8dc1223a2052fe4a9d95 Mon Sep 17 00:00:00 2001 From: mengxiong10 <15623530290@163.com> Date: Sun, 9 Aug 2020 20:23:51 +0800 Subject: [PATCH] fix: provide scoped slot to `input` slot (#492) --- src/date-picker.vue | 59 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/src/date-picker.vue b/src/date-picker.vue index ad2ce19e..e988fc54 100644 --- a/src/date-picker.vue +++ b/src/date-picker.vue @@ -8,19 +8,47 @@ }" >
- + @@ -456,10 +484,15 @@ export default { this.$emit('update:open', false); }, blur() { - this.$refs.input.blur(); + // when use slot input + if (this.$refs.input) { + this.$refs.input.blur(); + } }, focus() { - this.$refs.input.focus(); + if (this.$refs.input) { + this.$refs.input.focus(); + } }, handleInputChange() { if (!this.editable || this.userInput === null) return;