Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
liyeyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cfld-frontend
liyeyun
Commits
1c3fe6ff
Commit
1c3fe6ff
authored
Dec 15, 2023
by
王玉鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 手机号位数限制修改
parent
dbea8eea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
LoginView.vue
src/components/login/LoginView.vue
+12
-5
No files found.
src/components/login/LoginView.vue
View file @
1c3fe6ff
...
...
@@ -18,7 +18,6 @@
v-model=
"phoneNum"
class=
"phone-input"
type=
"number"
maxlength=
"11"
placeholder=
"请输入手机号"
@
blur=
"verify('phone')"
></ElInput>
...
...
@@ -63,7 +62,6 @@
v-model=
"phoneNum"
class=
"phone-input"
type=
"number"
maxlength=
"11"
placeholder=
"请输入手机号"
@
blur=
"verify('phone')"
/>
...
...
@@ -107,7 +105,6 @@
v-model=
"phoneNum"
class=
"phone-input"
type=
"number"
maxlength=
"11"
placeholder=
"请输入手机号"
@
blur=
"verify('phone')"
></ElInput>
...
...
@@ -158,7 +155,6 @@
<ElInput
v-model=
"phoneNum"
class=
"phone-input"
maxlength=
"11"
type=
"number"
placeholder=
"请输入手机号"
@
blur=
"verify('phone')"
...
...
@@ -214,7 +210,7 @@ import { useLoginModal } from './login.ts';
const
appStore
=
useAppStore
();
// const emit = defineEmits(['close']);
const
phoneNum
=
ref
<
number
|
null
>
(
);
const
phoneNum
=
ref
<
string
|
null
>
(
''
);
const
verifyCode
=
ref
<
number
|
null
>
();
const
errorMsg
=
ref
<
string
|
null
>
();
const
password
=
ref
<
string
|
null
>
(
null
);
...
...
@@ -252,6 +248,17 @@ watch(
},
);
/** type number的maxlength无效,在此限制位数 */
watch
(
phoneNum
,
(
val
,
oldVal
)
=>
{
if
(
val
&&
val
?.
length
>
11
)
{
if
(
oldVal
?.
length
===
11
)
{
phoneNum
.
value
=
oldVal
;
}
else
{
phoneNum
.
value
=
val
.
substring
(
0
,
11
);
}
}
});
let
requestFn
:
any
=
null
;
const
request
=
(
url
:
any
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment