Vue regular problem

has an input input box, and you need to add a regular

to its keyboard event.

the requirements are as follows:

  • users can only enter letters and numbers (no spaces)
  • convert to uppercase letters automatically if lowercase letters are entered
  • if you enter spaces or other symbols, all Filter drops

str=str.replace(/[^a-z\d]/ig, '').toUpperCase()

controls all uppercase text with text-transform:uppercase; .


str=str.replace(/[^a-zA-Z0-9]/g, '').toUpperCase()
Menu