[Vuejs]-Keeping zeros as first characters on an input in html

0👍

The following should work as you expect

<template>
  number: {{ number }}
  <input :value="number" @input="updateNumber" type="number">
</template>

<script>
export default {
  data() {
    return {
      number: 12
    }
  },
  methods: {
    updateNumber(e) {
      this.number = e.target.value
    }
  }
}
</script>

Here is a playground.

Leave a comment