Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7581fb38
authored
Dec 15, 2024
by
Netfan
Committed by
GitHub
Dec 15, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: pinInput value synchronous update (#5142)
1 parent
bedf1999
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
6 deletions
apps/web-antd/src/views/_core/authentication/code-login.vue
apps/web-ele/src/views/_core/authentication/code-login.vue
apps/web-naive/src/views/_core/authentication/code-login.vue
packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue
packages/locales/src/langs/en-US/authentication.json
packages/locales/src/langs/zh-CN/authentication.json
playground/src/views/_core/authentication/code-login.vue
apps/web-antd/src/views/_core/authentication/code-login.vue
View file @
7581fb3
...
@@ -10,6 +10,7 @@ import { $t } from '@vben/locales';
...
@@ -10,6 +10,7 @@ import { $t } from '@vben/locales';
defineOptions
({
name
:
'CodeLogin'
});
defineOptions
({
name
:
'CodeLogin'
});
const
loading
=
ref
(
false
);
const
loading
=
ref
(
false
);
const
CODE_LENGTH
=
6
;
const
formSchema
=
computed
(():
VbenFormSchema
[]
=>
{
const
formSchema
=
computed
(():
VbenFormSchema
[]
=>
{
return
[
return
[
...
@@ -30,6 +31,7 @@ const formSchema = computed((): VbenFormSchema[] => {
...
@@ -30,6 +31,7 @@ const formSchema = computed((): VbenFormSchema[] => {
{
{
component
:
'VbenPinInput'
,
component
:
'VbenPinInput'
,
componentProps
:
{
componentProps
:
{
codeLength
:
CODE_LENGTH
,
createText
:
(
countdown
:
number
)
=>
{
createText
:
(
countdown
:
number
)
=>
{
const
text
=
const
text
=
countdown
>
0
countdown
>
0
...
@@ -41,7 +43,9 @@ const formSchema = computed((): VbenFormSchema[] => {
...
@@ -41,7 +43,9 @@ const formSchema = computed((): VbenFormSchema[] => {
},
},
fieldName
:
'code'
,
fieldName
:
'code'
,
label
:
$t
(
'authentication.code'
),
label
:
$t
(
'authentication.code'
),
rules
:
z
.
string
().
min
(
1
,
{
message
:
$t
(
'authentication.codeTip'
)
}),
rules
:
z
.
string
().
length
(
CODE_LENGTH
,
{
message
:
$t
(
'authentication.codeTip'
,
[
CODE_LENGTH
]),
}),
},
},
];
];
});
});
...
...
apps/web-ele/src/views/_core/authentication/code-login.vue
View file @
7581fb3
...
@@ -10,6 +10,7 @@ import { $t } from '@vben/locales';
...
@@ -10,6 +10,7 @@ import { $t } from '@vben/locales';
defineOptions
({
name
:
'CodeLogin'
});
defineOptions
({
name
:
'CodeLogin'
});
const
loading
=
ref
(
false
);
const
loading
=
ref
(
false
);
const
CODE_LENGTH
=
6
;
const
formSchema
=
computed
(():
VbenFormSchema
[]
=>
{
const
formSchema
=
computed
(():
VbenFormSchema
[]
=>
{
return
[
return
[
...
@@ -30,6 +31,7 @@ const formSchema = computed((): VbenFormSchema[] => {
...
@@ -30,6 +31,7 @@ const formSchema = computed((): VbenFormSchema[] => {
{
{
component
:
'VbenPinInput'
,
component
:
'VbenPinInput'
,
componentProps
:
{
componentProps
:
{
codeLength
:
CODE_LENGTH
,
createText
:
(
countdown
:
number
)
=>
{
createText
:
(
countdown
:
number
)
=>
{
const
text
=
const
text
=
countdown
>
0
countdown
>
0
...
@@ -41,7 +43,9 @@ const formSchema = computed((): VbenFormSchema[] => {
...
@@ -41,7 +43,9 @@ const formSchema = computed((): VbenFormSchema[] => {
},
},
fieldName
:
'code'
,
fieldName
:
'code'
,
label
:
$t
(
'authentication.code'
),
label
:
$t
(
'authentication.code'
),
rules
:
z
.
string
().
min
(
1
,
{
message
:
$t
(
'authentication.codeTip'
)
}),
rules
:
z
.
string
().
length
(
CODE_LENGTH
,
{
message
:
$t
(
'authentication.codeTip'
,
[
CODE_LENGTH
]),
}),
},
},
];
];
});
});
...
...
apps/web-naive/src/views/_core/authentication/code-login.vue
View file @
7581fb3
...
@@ -10,6 +10,7 @@ import { $t } from '@vben/locales';
...
@@ -10,6 +10,7 @@ import { $t } from '@vben/locales';
defineOptions
({
name
:
'CodeLogin'
});
defineOptions
({
name
:
'CodeLogin'
});
const
loading
=
ref
(
false
);
const
loading
=
ref
(
false
);
const
CODE_LENGTH
=
6
;
const
formSchema
=
computed
(():
VbenFormSchema
[]
=>
{
const
formSchema
=
computed
(():
VbenFormSchema
[]
=>
{
return
[
return
[
...
@@ -30,6 +31,7 @@ const formSchema = computed((): VbenFormSchema[] => {
...
@@ -30,6 +31,7 @@ const formSchema = computed((): VbenFormSchema[] => {
{
{
component
:
'VbenPinInput'
,
component
:
'VbenPinInput'
,
componentProps
:
{
componentProps
:
{
codeLength
:
CODE_LENGTH
,
createText
:
(
countdown
:
number
)
=>
{
createText
:
(
countdown
:
number
)
=>
{
const
text
=
const
text
=
countdown
>
0
countdown
>
0
...
@@ -41,7 +43,9 @@ const formSchema = computed((): VbenFormSchema[] => {
...
@@ -41,7 +43,9 @@ const formSchema = computed((): VbenFormSchema[] => {
},
},
fieldName
:
'code'
,
fieldName
:
'code'
,
label
:
$t
(
'authentication.code'
),
label
:
$t
(
'authentication.code'
),
rules
:
z
.
string
().
min
(
1
,
{
message
:
$t
(
'authentication.codeTip'
)
}),
rules
:
z
.
string
().
length
(
CODE_LENGTH
,
{
message
:
$t
(
'authentication.codeTip'
,
[
CODE_LENGTH
]),
}),
},
},
];
];
});
});
...
...
packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue
View file @
7581fb3
...
@@ -47,6 +47,10 @@ watch(
...
@@ -47,6 +47,10 @@ watch(
},
},
);
);
watch
(
inputValue
,
(
val
)
=>
{
modelValue
.
value
=
val
.
join
(
''
);
});
function
handleComplete
(
e
:
string
[])
{
function
handleComplete
(
e
:
string
[])
{
modelValue
.
value
=
e
.
join
(
''
);
modelValue
.
value
=
e
.
join
(
''
);
emit
(
'complete'
);
emit
(
'complete'
);
...
...
packages/locales/src/langs/en-US/authentication.json
View file @
7581fb3
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
"qrcodeLogin"
:
"QR Code Login"
,
"qrcodeLogin"
:
"QR Code Login"
,
"codeSubtitle"
:
"Enter your phone number to start managing your project"
,
"codeSubtitle"
:
"Enter your phone number to start managing your project"
,
"code"
:
"Security code"
,
"code"
:
"Security code"
,
"codeTip"
:
"Security code
is required
"
,
"codeTip"
:
"Security code
required {0} characters
"
,
"mobile"
:
"Mobile"
,
"mobile"
:
"Mobile"
,
"mobileLogin"
:
"Mobile Login"
,
"mobileLogin"
:
"Mobile Login"
,
"mobileTip"
:
"Please enter mobile number"
,
"mobileTip"
:
"Please enter mobile number"
,
...
...
packages/locales/src/langs/zh-CN/authentication.json
View file @
7581fb3
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
"qrcodeLogin"
:
"扫码登录"
,
"qrcodeLogin"
:
"扫码登录"
,
"codeSubtitle"
:
"请输入您的手机号码以开始管理您的项目"
,
"codeSubtitle"
:
"请输入您的手机号码以开始管理您的项目"
,
"code"
:
"验证码"
,
"code"
:
"验证码"
,
"codeTip"
:
"请输入验证码"
,
"codeTip"
:
"请输入
{0}位
验证码"
,
"mobile"
:
"手机号码"
,
"mobile"
:
"手机号码"
,
"mobileTip"
:
"请输入手机号"
,
"mobileTip"
:
"请输入手机号"
,
"mobileErrortip"
:
"手机号码格式错误"
,
"mobileErrortip"
:
"手机号码格式错误"
,
...
...
playground/src/views/_core/authentication/code-login.vue
View file @
7581fb3
...
@@ -10,6 +10,7 @@ import { $t } from '@vben/locales';
...
@@ -10,6 +10,7 @@ import { $t } from '@vben/locales';
defineOptions
({
name
:
'CodeLogin'
});
defineOptions
({
name
:
'CodeLogin'
});
const
loading
=
ref
(
false
);
const
loading
=
ref
(
false
);
const
CODE_LENGTH
=
6
;
const
formSchema
=
computed
(():
VbenFormSchema
[]
=>
{
const
formSchema
=
computed
(():
VbenFormSchema
[]
=>
{
return
[
return
[
...
@@ -30,6 +31,7 @@ const formSchema = computed((): VbenFormSchema[] => {
...
@@ -30,6 +31,7 @@ const formSchema = computed((): VbenFormSchema[] => {
{
{
component
:
'VbenPinInput'
,
component
:
'VbenPinInput'
,
componentProps
:
{
componentProps
:
{
codeLength
:
CODE_LENGTH
,
createText
:
(
countdown
:
number
)
=>
{
createText
:
(
countdown
:
number
)
=>
{
const
text
=
const
text
=
countdown
>
0
countdown
>
0
...
@@ -41,7 +43,9 @@ const formSchema = computed((): VbenFormSchema[] => {
...
@@ -41,7 +43,9 @@ const formSchema = computed((): VbenFormSchema[] => {
},
},
fieldName
:
'code'
,
fieldName
:
'code'
,
label
:
$t
(
'authentication.code'
),
label
:
$t
(
'authentication.code'
),
rules
:
z
.
string
().
min
(
1
,
{
message
:
$t
(
'authentication.codeTip'
)
}),
rules
:
z
.
string
().
length
(
CODE_LENGTH
,
{
message
:
$t
(
'authentication.codeTip'
,
[
CODE_LENGTH
]),
}),
},
},
];
];
});
});
...
...
Write
Preview
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