WebApp【公共组件库】@前端(For Git Submodule)
‘chensiAb’
2025-03-25 3b03f87a02458f719e2eb4bf112a13441b427d14
forms/input/CInputPhoneCode.vue
@@ -50,16 +50,17 @@
        },
        // 发送请求,通知后端给手机发验证码
        onCallPhoneCode: Function,
        // 刷新cd  重新刷新回60秒通知父组件更新图片地址
        // 刷新cd后,通知父组件更新图片地址
        onRefreshCD: {
            type: Function,
            default: () => {},
            default: () => () => null,
        },
    },
    data() {
        return {
            cd: 60,
            holding: false,
            timer: null,
        };
    },
    computed: {
@@ -79,7 +80,8 @@
            const startCD = () => {
                this.holding = true;
                this.cd = 60;
                setInterval(() => {
                clearInterval(this.timer);
                this.timer = setInterval(() => {
                    this.cd -= 1;
                    if (this.cd === 0) {
                        this.holding = false;
@@ -97,6 +99,10 @@
                });
            }
        },
        // 重置holding
        $resetHolding() {
            this.holding = false;
        },
    },
};
</script>