DioxideCN / Tool-Bench

为Halo博客集成更多标签样式与功能支持
GNU General Public License v3.0
47 stars 3 forks source link

vue3 input tag value has been translated #6

Closed DioxideCN closed 1 year ago

DioxideCN commented 1 year ago

simple case:

const onSearch = (value: string): void => {
  console.log(value)
  const val2: string = (document.getElementById("amber-input") as HTMLInputElement).value
  console.log(val2)
}

const createRegex = (search: string): void => {
  const flag: string = "gi";
  let regex: RegExp;
  try {
    regex = new RegExp(search, flag);
    console.log(regex)
  } catch (e) {
    console.log('none')
  }
}

In vue3.3.4 this input tag's $event.target.value will not translate the string value, like \((.*)\)\n to ((.*)) but this project this will happen in console/src/util/SearchUtil.ts. More details can be found in StackOverflow