<input type="text" v-model="name">
watch: {
name(curVal, oldVal) {
if (curVal.length > 10) {
this.name = String(curVal).slice(0, this.name);
}
}
},
<input type="text" v-model="name">
watch: {
name(curVal, oldVal) {
if (curVal.length > 10) {
this.name = String(curVal).slice(0, this.name);
}
}
},