mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 登录页面实现
This commit is contained in:
15
src/hooks/business/useSmsCode.ts
Normal file
15
src/hooks/business/useSmsCode.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { computed } from 'vue';
|
||||
import useCountDown from './useCountDown';
|
||||
|
||||
export default function useSmsCode() {
|
||||
const { counts, start, isCounting } = useCountDown(60);
|
||||
const initLabel = '获取验证码';
|
||||
const countingLabel = (second: number) => `${second}秒后重新获取`;
|
||||
const label = computed(() => (isCounting.value ? countingLabel(counts.value) : initLabel));
|
||||
|
||||
return {
|
||||
label,
|
||||
start,
|
||||
isCounting
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user