From 1e17564989ec6afebd29876b86de35faeaff788a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Wed, 27 Jun 2018 15:40:03 +0800 Subject: [PATCH] Input add @on-search event --- examples/routers/input.vue | 11 ++++++++--- src/components/input/input.vue | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/routers/input.vue b/examples/routers/input.vue index acfbd3cc..c8d0136c 100644 --- a/examples/routers/input.vue +++ b/examples/routers/input.vue @@ -129,11 +129,11 @@



- +

- +

- + diff --git a/src/components/input/input.vue b/src/components/input/input.vue index 67d1b4e9..045f7d57 100644 --- a/src/components/input/input.vue +++ b/src/components/input/input.vue @@ -218,6 +218,7 @@ methods: { handleEnter (event) { this.$emit('on-enter', event); + if (this.search) this.$emit('on-search', this.currentValue); }, handleKeydown (event) { this.$emit('on-keydown', event); @@ -292,8 +293,9 @@ this.$emit('on-change', e); }, handleSearch () { - if (this.disable) return false; + if (this.disabled) return false; this.$refs.input.focus(); + this.$emit('on-search', this.currentValue); } }, watch: {