Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
dance-pc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
7dc17705
authored
2025-05-12 10:09:17 +0800
by
杨炀
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
中文/英文输入限制
1 parent
daf0e98f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
src/viewsPc/match/components/affix-invitation.vue
src/viewsPc/match/components/affix-invitation.vue
View file @
7dc1770
...
...
@@ -25,7 +25,7 @@
<el-form
:model=
"form"
:rules=
"rules"
ref=
"iformRef"
label-position=
"right"
label-width=
"150px"
v-else
>
<el-form-item
:label=
"language==0?'姓名':'Name'"
required
prop=
"name"
>
<el-input
v-model=
"form.name"
/>
<el-input
v-model=
"form.name"
@
input=
"handleInput"
/>
</el-form-item>
<el-form-item
:label=
"language==0?'性别':'Gender'"
required
prop=
"gender"
>
<el-radio-group
v-model=
"form.gender"
>
...
...
@@ -141,7 +141,21 @@ function getCountryList() {
countrys
.
value
=
res
.
data
})
}
const
handleInput
=
(
value
)
=>
{
const
regex
=
/^
[
a-zA-Z
]
*$/
;
const
regexCh
=
/^
[\u
4e00-
\u
9fa5
]
+$/
;
if
(
language
.
value
==
0
){
if
(
!
regexCh
.
test
(
value
))
{
form
.
value
.
name
=
''
ElMessage
.
warning
(
'请输入中文'
)
}
}
else
{
if
(
!
regex
.
test
(
value
))
{
form
.
value
.
name
=
''
ElMessage
.
warning
(
'Please enter English only'
)
}
}
}
const
submit
=
()
=>
{
proxy
.
$refs
.
iformRef
.
validate
(
valid
=>
{
if
(
form
.
value
.
email
.
indexOf
(
'@'
)
==
-
1
)
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment