From 57739f960bad161b0824f5b813f4ffe39cfc89b4 Mon Sep 17 00:00:00 2001 From: chansee97 Date: Sat, 8 Jun 2024 13:58:09 +0800 Subject: [PATCH] fix: revert `useDefault` --- src/hooks/index.ts | 1 - src/hooks/useDefault.ts | 15 ------------ .../setting/account/components/TableModal.vue | 11 ++++----- .../setting/menu/components/TableModal.vue | 24 ++++--------------- 4 files changed, 10 insertions(+), 41 deletions(-) delete mode 100644 src/hooks/useDefault.ts diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 9d7e9f6..c42edf9 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,4 +1,3 @@ export * from './useBoolean' export * from './useEcharts' export * from './usePermission' -export * from './useDefault' diff --git a/src/hooks/useDefault.ts b/src/hooks/useDefault.ts deleted file mode 100644 index 7aa931e..0000000 --- a/src/hooks/useDefault.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Apply default value to a ref. - */ -export function useDefault(defaultValue: T): Ref { - const source: Ref = ref() - - return computed({ - get() { - return source.value ?? defaultValue - }, - set(value) { - source.value = value - }, - }) -} diff --git a/src/views/setting/account/components/TableModal.vue b/src/views/setting/account/components/TableModal.vue index a33a4f2..f2ecc5c 100644 --- a/src/views/setting/account/components/TableModal.vue +++ b/src/views/setting/account/components/TableModal.vue @@ -1,5 +1,5 @@