Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复u-number-box删除最后一位数字后 再次focus再次删除时值为空的问题 导致和v-model值不一致的问题 #1115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions uni_modules/uview-ui/components/u-number-box/u-number-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@
onBlur(event) {
// 对输入值进行格式化
const value = this.format(event.detail.value)
if(value !== this.currentValue){
//如果输入的值为空需要将值修改为最小值
if(this.currentValue === ''){
this.currentValue = value;
}
this.emitChange(value);
}
// 发出blur事件
this.$emit(
'blur',{
Expand Down