|
|
|
|
@ -687,9 +687,11 @@ const changeShapeText = (e: any) => {
@@ -687,9 +687,11 @@ const changeShapeText = (e: any) => {
|
|
|
|
|
console.log('changeShapeText', e.target.value) |
|
|
|
|
if (!validateInput(e.target.value)) { |
|
|
|
|
showToast('输入的文字不能包含特殊符号!') |
|
|
|
|
} else { |
|
|
|
|
handleInput(e.target.value) |
|
|
|
|
// 移除特殊符号,仅保留字母、数字、中文和空格 |
|
|
|
|
shapeText.value = e.target.value.replace(/[^a-zA-Z0-9\u4e00-\u9fa5\s]/g, ''); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
handleInput(e.target.value) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const validateInput = (input: string) => { |
|
|
|
|
|