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

View File

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

View File

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

View File

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