lifanagju_citu 6 месяцев назад
Родитель
Сommit
f4fa223501
1 измененных файлов с 11 добавлено и 1 удалено
  1. 11 1
      src/plugins/necessaryInfo/components/infoForm.vue

+ 11 - 1
src/plugins/necessaryInfo/components/infoForm.vue

@@ -47,7 +47,17 @@ const items = ref({
       default: null,
       label: '姓名 *',
       outlined: true,
-      rules: [v => !!v || '请输入姓名']
+      rules: [
+        value => {
+          if (value) return true
+          return '请输入您的中文名'
+        },
+        value => {
+          var regex = /^[\u4e00-\u9fa5]+$/
+          if (regex.test(value)) return true
+          return '请输入正确的中文名'
+        }
+      ]
     },
     {
       type: 'autocomplete',