zjk
2026-08-31 0284ff93129252683da82ed01f0e60f81839761c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { ExtractPropTypes, PropType } from 'vue';
import { baseProps } from '../common/props';
 
/**
 * VerificationCodeProps 验证码输入框 props 类型定义
 * @description 验证码输入倒计时组件
 */
export const VerificationCodeProps = {
    ...baseProps,
    /** 倒计时时长,单位秒 */
    seconds: { type: [String, Number] as PropType<string | number>, default: 60 },
    /** 开始时按钮文字 */
    startText: { type: String, default: '获取验证码' },
    /** 倒计时进行中按钮文字,X为剩余秒数 */
    changeText: { type: String, default: 'X秒重新获取' },
    /** 结束时按钮文字 */
    endText: { type: String, default: '重新获取' },
    /** 是否保持倒计时不中断(如页面切换) */
    keepRunning: { type: Boolean, default: false },
    /** 唯一标识key,用于区分多个验证码组件 */
    uniqueKey: { type: String, default: '' }
};
 
export type VerificationCodeProps = ExtractPropTypes<typeof VerificationCodeProps>;