mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
[new feature] Number: support v-model (#3531)
This commit is contained in:
@@ -16,6 +16,10 @@ export default sfc({
|
||||
})
|
||||
],
|
||||
|
||||
model: {
|
||||
event: 'update:value'
|
||||
},
|
||||
|
||||
props: {
|
||||
show: Boolean,
|
||||
title: String,
|
||||
@@ -26,6 +30,10 @@ export default sfc({
|
||||
type: String,
|
||||
default: 'default'
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
extraKey: {
|
||||
type: String,
|
||||
default: ''
|
||||
@@ -103,12 +111,16 @@ export default sfc({
|
||||
return;
|
||||
}
|
||||
|
||||
const { value } = this;
|
||||
|
||||
if (type === 'delete') {
|
||||
this.$emit('delete');
|
||||
this.$emit('update:value', value.slice(0, value.length - 1));
|
||||
} else if (type === 'close') {
|
||||
this.onClose();
|
||||
} else {
|
||||
this.$emit('input', text);
|
||||
this.$emit('update:value', value + text);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user