fix: 修复 UserCaptcha 组件 sendState 实时更新问题
This commit is contained in:
parent
38e123dfc4
commit
233a10399d
|
|
@ -356,6 +356,35 @@ const updateSendState = () => {
|
||||||
sendState.value = { isCounting: t.isCounting.value, countdown: t.countdown.value };
|
sendState.value = { isCounting: t.isCounting.value, countdown: t.countdown.value };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 监听 editField 变化,实时更新 sendState
|
||||||
|
watch(
|
||||||
|
() => editField.value,
|
||||||
|
() => {
|
||||||
|
nextTick(() => {
|
||||||
|
updateSendState();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 监听倒计时状态变化,实时同步到 sendState
|
||||||
|
watch(
|
||||||
|
() => phoneCaptchaState.countdown.value,
|
||||||
|
() => {
|
||||||
|
if (editField.value === 'mobile') {
|
||||||
|
updateSendState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => emailCaptchaState.countdown.value,
|
||||||
|
() => {
|
||||||
|
if (editField.value === 'email') {
|
||||||
|
updateSendState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 语言切换
|
// 语言切换
|
||||||
const handleLanguageChange = async (val: number) => {
|
const handleLanguageChange = async (val: number) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue