[Vuejs]-Vue 2 Input not updating with leading zeors

0👍

If you want to still emit that as a number then you can solve that by doing the below

<input type="tel" pattern="[0-9]*">

and then in the methods

methods: {
        handleInput: function (val) {
            // Removed the parseInt line
            this.$set(this, 'local_value', val.target.value);
            this.$emit('input', val.target.value);
        }
    }

Leave a comment