From 7dbde804d8a85099c77dbbbf80133eec5a508af8 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Tue, 8 May 2018 12:47:03 +0200 Subject: [PATCH] add on-clear event --- examples/routers/select.vue | 21 +++++++++++++-------- src/components/select/select-head.vue | 5 ++++- src/components/select/select.vue | 2 ++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/routers/select.vue b/examples/routers/select.vue index 6beda00..cc34197 100644 --- a/examples/routers/select.vue +++ b/examples/routers/select.vue @@ -671,16 +671,16 @@ @@ -165,6 +165,9 @@ if (this.filterable && e.target === this.$el){ this.$refs.input.focus(); } + }, + onClear(){ + this.$emit('on-clear'); } }, watch: { diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 6ca51b3..709115c 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -42,6 +42,7 @@ @on-query-change="onQueryChange" @on-input-focus="isFocused = true" @on-input-blur="isFocused = false" + @on-clear="clearSingleSelect" /> @@ -382,6 +383,7 @@ } }, clearSingleSelect(){ // PUBLIC API + this.$emit('on-clear'); if (this.clearable) this.values = []; }, getOptionData(value){ -- libgit2 0.21.4