|
|
|
|
@ -685,7 +685,17 @@ const textShow = (item: any) => {
@@ -685,7 +685,17 @@ const textShow = (item: any) => {
|
|
|
|
|
const shapeText = ref('') |
|
|
|
|
const changeShapeText = (e: any) => { |
|
|
|
|
console.log('changeShapeText', e.target.value) |
|
|
|
|
if (!validateInput(e.target.value)) { |
|
|
|
|
showToast('输入的文字不能包含特殊符号!') |
|
|
|
|
} else { |
|
|
|
|
handleInput(e.target.value) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const validateInput = (input: string) => { |
|
|
|
|
// 正则说明:只允许字母(大小写)、数字、中文和空格 |
|
|
|
|
const regex = /^[a-zA-Z0-9\u4e00-\u9fa5\s]+$/; |
|
|
|
|
return regex.test(input); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const handleInput = (value: string) => { |
|
|
|
|
|