Skip to content

Commit

Permalink
fix: remove useLoading
Browse files Browse the repository at this point in the history
  • Loading branch information
chansee97 committed Jun 3, 2024
1 parent 5945e63 commit 648a0ba
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './useBoolean'
export * from './useLoading'
export * from './useEcharts'
export * from './usePermission'
15 changes: 0 additions & 15 deletions src/hooks/useLoading.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/views/list/commonList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { DataTableColumns, FormInst } from 'naive-ui'
import { NButton, NPopconfirm, NSpace, NSwitch, NTag } from 'naive-ui'
import TableModal from './components/TableModal.vue'
import { fetchUserList } from '@/service'
import { useBoolean, useLoading } from '@/hooks'
import { useBoolean } from '@/hooks'
import { Gender } from '@/constants'
const { loading, startLoading, endLoading } = useLoading(false)
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(false)
const { bool: visible, setTrue: openModal } = useBoolean(false)
const initialModel = {
Expand Down
4 changes: 2 additions & 2 deletions src/views/setting/account/components/TableModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { useBoolean, useLoading } from '@/hooks'
import { useBoolean } from '@/hooks'
import { fetchRoleList } from '@/service'
interface Props {
Expand All @@ -17,7 +17,7 @@ const emit = defineEmits<{
const { bool: modalVisible, setTrue: showModal, setFalse: hiddenModal } = useBoolean(false)
const { loading: submitLoading, startLoading, endLoading } = useLoading(false)
const { bool: submitLoading, setTrue: startLoading, setFalse: endLoading } = useBoolean(false)
const formModel = ref()
const defaultFormModal: Entity.User = {
Expand Down
4 changes: 2 additions & 2 deletions src/views/setting/account/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type { DataTableColumns, FormInst } from 'naive-ui'
import { NButton, NPopconfirm, NSpace, NSwitch, NTag } from 'naive-ui'
import TableModal from './components/TableModal.vue'
import { fetchUserPage } from '@/service'
import { useLoading } from '@/hooks'
import { useBoolean } from '@/hooks'
import { Gender } from '@/constants'
import CopyText from '@/components/custom/CopyText.vue'
const { loading, startLoading, endLoading } = useLoading(false)
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(false)
const initialModel = {
condition_1: '',
Expand Down
5 changes: 2 additions & 3 deletions src/views/setting/menu/components/TableModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
FormItemRule,
} from 'naive-ui'
import HelpInfo from '@/components/common/HelpInfo.vue'
import { useBoolean, useLoading } from '@/hooks'
import { useBoolean } from '@/hooks'
import { Regex } from '@/constants'
import { fetchRoleList } from '@/service'
Expand All @@ -22,8 +22,7 @@ const emit = defineEmits<{
}>()
const { bool: modalVisible, setTrue: showModal, setFalse: hiddenModal } = useBoolean(false)
const { loading: submitLoading, startLoading, endLoading } = useLoading(false)
const { bool: submitLoading, setTrue: startLoading, setFalse: endLoading } = useBoolean(false)
const defaultFormModal: AppRoute.RowRoute = {
'name': '',
Expand Down
4 changes: 2 additions & 2 deletions src/views/setting/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type { DataTableColumns } from 'naive-ui'
import { NButton, NPopconfirm, NSpace, NTag } from 'naive-ui'
import TableModal from './components/TableModal.vue'
import { fetchAllRoutes } from '@/service'
import { useLoading } from '@/hooks'
import { useBoolean } from '@/hooks'
import { arrayToTree, renderIcon } from '@/utils'
import CopyText from '@/components/custom/CopyText.vue'
const { loading, startLoading, endLoading } = useLoading(false)
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(false)
function deleteData(id: number) {
window.$message.success(`删除菜单id:${id}`)
Expand Down

0 comments on commit 648a0ba

Please sign in to comment.