Skip to content

Commit 897c905

Browse files
committed
fix(uni-search-bar): modelValue is old value when executing clear event
1 parent 883bb16 commit 897c905

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue

+7-5
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@
177177
},
178178
clear() {
179179
this.searchVal = ""
180-
this.$emit("clear", '');
180+
this.$nextTick(() => {
181+
this.$emit("clear", { value: "" })
182+
})
181183
},
182184
cancel() {
183185
if(this.readonly) return
@@ -266,9 +268,9 @@
266268
.uni-searchbar__box-search-input {
267269
flex: 1;
268270
font-size: 14px;
269-
color: #333;
270-
margin-left: 5px;
271-
margin-top: 1px;
271+
color: #333;
272+
margin-left: 5px;
273+
margin-top: 1px;
272274
background-color: inherit;
273275
}
274276
@@ -284,7 +286,7 @@
284286
.uni-searchbar__text-placeholder {
285287
font-size: 14px;
286288
color: #B3B3B3;
287-
margin-left: 5px;
289+
margin-left: 5px;
288290
text-align: left;
289291
}
290292

0 commit comments

Comments
 (0)