This commit is contained in:
李志鹏
2025-09-22 11:01:28 +08:00
parent a1bbc2d166
commit 9d51fac99f
4 changed files with 15 additions and 28 deletions

5
components.d.ts vendored
View File

@@ -10,12 +10,10 @@ declare module 'vue' {
export interface GlobalComponents {
ABadge: typeof import('ant-design-vue/es')['Badge']
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADrawer: typeof import('ant-design-vue/es')['Drawer']
AImage: typeof import('ant-design-vue/es')['Image']
AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
AModal: typeof import('ant-design-vue/es')['Modal']
APagination: typeof import('ant-design-vue/es')['Pagination']
APopover: typeof import('ant-design-vue/es')['Popover']
ARangePicker: typeof import('ant-design-vue/es')['RangePicker']
ASelect: typeof import('ant-design-vue/es')['Select']
@@ -24,8 +22,9 @@ declare module 'vue' {
ASpin: typeof import('ant-design-vue/es')['Spin']
ASwitch: typeof import('ant-design-vue/es')['Switch']
ATable: typeof import('ant-design-vue/es')['Table']
ATabPane: typeof import('ant-design-vue/es')['TabPane']
ATabs: typeof import('ant-design-vue/es')['Tabs']
AUpload: typeof import('ant-design-vue/es')['Upload']
ElCascader: typeof import('element-plus/es')['ElCascader']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}

View File

@@ -565,18 +565,14 @@ export default defineComponent({
createTimer() {
this.timer = setInterval(() => {
this.time--;
if (!this.time) {
clearInterval(this.timer);
}
if (this.time <= 0) this.clearTimer(0);
}, 1000);
},
//清除定时器
clearTimer() {
this.time = 60;
if (this.timer) {
clearInterval(this.timer);
}
clearTimer(time?: number) {
this.time = time == undefined ? 60 : time;
if (this.timer) clearInterval(this.timer);
},
//跳转到首页

View File

@@ -565,18 +565,14 @@ export default defineComponent({
createTimer() {
this.timer = setInterval(() => {
this.time--;
if (!this.time) {
clearInterval(this.timer);
}
if (this.time <= 0) this.clearTimer(0);
}, 1000);
},
//清除定时器
clearTimer() {
this.time = 60;
if (this.timer) {
clearInterval(this.timer);
}
clearTimer(time?: number) {
this.time = time == undefined ? 60 : time;
if (this.timer) clearInterval(this.timer);
},
//跳转到首页

View File

@@ -563,22 +563,18 @@ export default defineComponent({
});
},
//创建定时器
//创建定时器
createTimer() {
this.timer = setInterval(() => {
this.time--;
if (!this.time) {
clearInterval(this.timer);
}
if (this.time <= 0) this.clearTimer(0);
}, 1000);
},
//清除定时器
clearTimer() {
this.time = 60;
if (this.timer) {
clearInterval(this.timer);
}
clearTimer(time?: number) {
this.time = time == undefined ? 60 : time;
if (this.timer) clearInterval(this.timer);
},
//跳转到首页