Browse Source

搜索框清零

jf 5 years ago
parent
commit
21752a4907
1 changed files with 7 additions and 1 deletions
  1. 7 1
      ghsApp/src/components/module/app-search.vue

+ 7 - 1
ghsApp/src/components/module/app-search.vue

@@ -10,7 +10,7 @@
 					ref="searchInput"
 					ref="searchInput"
 					v-model="search"
 					v-model="search"
 					:focus="focus"
 					:focus="focus"
-					@input="inputFn"
+					@input="inputFn" @focus="inputEmptyFn"
 					:style="{ fontSize: fontSize + 'rpx' }"
 					:style="{ fontSize: fontSize + 'rpx' }"
 					:placeholder="placeholder"
 					:placeholder="placeholder"
 					placeholder-class="placeholder"
 					placeholder-class="placeholder"
@@ -108,6 +108,12 @@ export default {
 			setTimeout(() => {
 			setTimeout(() => {
 				this.$emit("input", this.search);
 				this.$emit("input", this.search);
 			});
 			});
+		},
+		inputEmptyFn(e) {
+			this.search = '';
+			setTimeout(() => {
+				this.$emit("input", this.search);
+			});
 		}
 		}
 	}
 	}
 };
 };