search add change event

This commit is contained in:
cookfront
2017-03-30 14:47:52 +08:00
parent 2b3394bd35
commit 50d87fa634
2 changed files with 10 additions and 2 deletions
+6 -1
View File
@@ -2,7 +2,7 @@
<div class="zan-search" :class="{ 'zan-search--focus' : isFocus }">
<div class="zan-search__input-wrap">
<zan-icon name="search"></zan-icon>
<input type="text" :placeholder="placeholder" v-model="value" v-refocus="focusStatus" @focus="handleFocus" @keyup.enter="handleSearch">
<input type="text" :placeholder="placeholder" v-model="value" v-refocus="focusStatus" @focus="handleFocus" @keyup.enter="handleSearch">
<zan-icon name="clear" @click="handleClean"></zan-icon>
</div>
<div class="zan-search__cancel" :class="{ 'zan-search__cancel--focus' : isFocus }" @click="handleBack">取消</div>
@@ -22,6 +22,11 @@
type: String
}
},
watch: {
value(val) {
this.$emit('change', val);
}
},
data() {
return {
value: '',