Modify the value of input so that it does not flicker

getting the value of input requires that the user input is not displayed when it does not conform to the specification.
for example, the common idea that you can only count two decimal places is to delete the last one when you enter it to the third place. For example, the vue I use now gets the input value through v-model and then @ input filters the bound value assigned to v-model. However, in this filtering process, there will be a flicker process of deletion, that is, rendering to the screen first and disappearing. Do you have any good ways to deal with it? it"s not limited to vue. Thank you

.
Apr.29,2022

use keyup/input events

Native is like this:

let inp = document.querySelector ("input");

inp.onkeyup = inp.oninput = function (ev) {if (inp.value.length > = 3) {

inp.value = inp.value.substr(0, 3);   } };

vue, instead of v-model binding, change to:

< template >

<input :value ="inptxt" @input="input"> 

< / template >
< script >
exports default {

data(){
    return {
        inptxt:""
    }
},
methods: {
    input(){
        if(this.inptxt.length > 3) {
            this.inptxt = this.inptxt.substr(0,3);
        }
    }
} 

}
< / script >

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c061ee-31d12.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c061ee-31d12.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?