I want to create input in which I can replace entered chars with empty chars if the pattern doesn't match.
template:
<input
type="text"
:value="val"
@input="input"
/>
script:
import { ref } from "vue";
export default {
setup() {
let val = ref("");
const input = ({ target }) => {
val.value = target.value.replace(/[^\d]/g, "");
};
return { val, input };
},
};