fix: 修复一个正则表达式不被 safari 支持的问题

This commit is contained in:
ibuler 2023-06-08 15:47:15 +08:00 committed by Jiangjie.Bai
parent 15ac510c6f
commit 41cd77d75e

View File

@ -13,8 +13,8 @@ export const filterSelectValues = (values) => {
selects.push(item)
} else {
// 格式校验:不以:开头,不以:结尾
const rule = /^(?!:).*(?<!:)$/
if (item.name.indexOf(':') > -1 && rule.test(item.name)) {
const reg = /^:|:$/
if (item.name.indexOf(':') > -1 && !reg.test(item.name)) {
const [name, value] = item.name.split(':')
const inputValue = { name, value }
selects.push(inputValue)