fix: 优化部分setTime 0 的写法

This commit is contained in:
ZhuRui
2026-08-06 11:56:37 +08:00
parent 15a6d81851
commit 130a253b83
12 changed files with 24 additions and 24 deletions
@@ -1,4 +1,4 @@
import { defineComponent, ref, reactive, computed } from 'vue';
import { defineComponent, ref, reactive, computed, nextTick } from 'vue';
import { useEffect, useState } from '@/hooks';
import {
Modal,
@@ -305,7 +305,7 @@ export default defineComponent({
initFormFromRecord(props.record);
setCropperVisible(false);
setUploadImageUrl('');
setTimeout(() => formRef.value?.clearValidate(), 0);
nextTick().then(() => formRef.value?.clearValidate());
}
}, [() => props.visible]);
@@ -1,4 +1,4 @@
import { computed, reactive, toRef, Ref } from 'vue';
import { computed, reactive, toRef, Ref, nextTick } from 'vue';
import { Modal, message } from 'ant-design-vue';
import { useState, useDebounce } from '@/hooks';
import { useRequest } from '@/hooks/useRequest';
@@ -109,7 +109,7 @@ export function useEventListModel() {
if (pageSize !== (pagination as any).pageSize.value) {
pagination.setPageSize(pageSize);
}
setTimeout(fetchList, 0);
nextTick().then(() => fetchList());
};
const openDetailModal = (record: any) => {
@@ -1,4 +1,4 @@
import { computed, reactive, toRef, Ref, h } from 'vue';
import { computed, reactive, toRef, Ref, h, nextTick } from 'vue';
import { StatusTag, type StatusTagTone } from '@/components';
import { useDebounce } from '@/hooks';
import { useRequest } from '@/hooks/useRequest';
@@ -212,7 +212,7 @@ export function useOrderModel() {
if (pageSize !== (pagination as any).pageSize.value) {
pagination.setPageSize(pageSize);
}
setTimeout(fetchList, 0);
nextTick().then(() => fetchList());
};
return {
@@ -1,4 +1,4 @@
import { computed, reactive, toRef, Ref } from 'vue';
import { computed, reactive, toRef, Ref, nextTick } from 'vue';
import {
useDebounce,
useThrottleFn,
@@ -142,7 +142,7 @@ export function usePaymentsModel() {
if (pageSize !== (pagination as any).pageSize.value) {
pagination.setPageSize(pageSize);
}
setTimeout(fetchList, 0);
nextTick().then(() => fetchList());
};
return {
@@ -1,4 +1,4 @@
import { computed, reactive, toRef, Ref } from 'vue';
import { computed, reactive, toRef, Ref, nextTick } from 'vue';
import {
useState,
useDebounce,
@@ -175,7 +175,7 @@ export function useWalletModel() {
if (pageSize !== (pagination as any).pageSize.value) {
pagination.setPageSize(pageSize);
}
setTimeout(fetchList, 0);
nextTick().then(() => fetchList());
};
const handleViewDetail = (record: any) => {
@@ -1,4 +1,4 @@
import { computed, reactive, toRef, Ref, h } from 'vue';
import { computed, reactive, toRef, Ref, h, nextTick } from 'vue';
import { StatusTag, type StatusTagTone } from '@/components';
import {
useState,
@@ -197,7 +197,7 @@ export function useWithdrawModel() {
if (pageSize !== (pagination as any).pageSize.value) {
pagination.setPageSize(pageSize);
}
setTimeout(fetchList, 0);
nextTick().then(() => fetchList());
};
/** 打开审核弹窗 */
+2 -2
View File
@@ -1,4 +1,4 @@
import { computed, reactive, toRef, Ref } from 'vue';
import { computed, reactive, toRef, Ref, nextTick } from 'vue';
import dayjs from 'dayjs';
import { useDebounce, useThrottleFn } from '@/hooks';
import { useRequest } from '@/hooks/useRequest';
@@ -138,7 +138,7 @@ export function useLogModel() {
if (pageSize !== (pagination as any).pageSize.value) {
pagination.setPageSize(pageSize);
}
setTimeout(fetchList, 0);
nextTick().then(() => fetchList());
};
return {
@@ -1,4 +1,4 @@
import { defineComponent, ref, reactive } from 'vue';
import { defineComponent, ref, reactive, nextTick } from 'vue';
import { useEffect } from '@/hooks';
import { Modal, Form, Input, Tree, Button, Spin, message } from 'ant-design-vue';
import type { TreeProps } from 'ant-design-vue';
@@ -82,7 +82,7 @@ export default defineComponent({
useEffect(() => {
if (props.visible) {
initFormFromRecord(props.record);
setTimeout(() => formRef.value?.clearValidate(), 0);
nextTick().then(() => formRef.value?.clearValidate());
}
}, [() => props.visible]);
+2 -2
View File
@@ -1,4 +1,4 @@
import { computed, reactive, toRef, Ref } from 'vue';
import { computed, reactive, toRef, Ref, nextTick } from 'vue';
import { message } from 'ant-design-vue';
import { useState, useDebounce, useThrottleFn } from '@/hooks';
import { useRequest } from '@/hooks/useRequest';
@@ -107,7 +107,7 @@ export function useRoleModel() {
if (pageSize !== (pagination as any).pageSize.value) {
pagination.setPageSize(pageSize);
}
setTimeout(fetchList, 0);
nextTick().then(() => fetchList());
};
/** 新增 */
@@ -1,4 +1,4 @@
import { defineComponent, ref, reactive } from 'vue';
import { defineComponent, ref, reactive, nextTick } from 'vue';
import { useEffect, useState } from '@/hooks';
import { Modal, Form, Input, Select, Button } from 'ant-design-vue';
import { getRoleList, type TournamentAdminRolePageVO } from '../../roles/model/services';
@@ -166,7 +166,7 @@ export default defineComponent({
if (props.visible) {
initFormFromRecord(props.record);
setIsResetting(false);
setTimeout(() => formRef.value?.clearValidate(), 0);
nextTick().then(() => formRef.value?.clearValidate());
}
}, [() => props.visible]);
+2 -2
View File
@@ -1,4 +1,4 @@
import { computed, reactive, toRef, Ref, h, ref } from 'vue';
import { computed, reactive, toRef, Ref, h, ref, nextTick } from 'vue';
import { message } from 'ant-design-vue';
import { StatusTag, type StatusTagTone } from '@/components';
import { useDebounce, useThrottleFn } from '@/hooks';
@@ -150,7 +150,7 @@ export function useUserModel() {
if (pageSize !== (pagination as any).pageSize.value) {
pagination.setPageSize(pageSize);
}
setTimeout(fetchList, 0);
nextTick().then(() => fetchList());
};
// ===== 初始化:加载角色选项 =====