【调整】前后空格移除的方法和调整部分提示不准确的问题

This commit is contained in:
chudong
2025-05-20 11:45:02 +08:00
parent 59dc0a4108
commit ad0cd016f6
128 changed files with 10519 additions and 10314 deletions

View File

@@ -0,0 +1,17 @@
/**
* @description 移除输入框中的空格
* @param {string} value 输入框的值
* @returns {boolean} 是否为空
*/
export const noSideSpace = (value: string) => {
return !value.startsWith(' ') && !value.endsWith(' ')
}
/**
* @description 数字验证
* @param {string} value 输入框的值
* @returns {boolean} 是否为数字
*/
export const onlyAllowNumber = (value: string) => {
return !value || /^\d+$/.test(value)
}