mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 09:14:27 +08:00
code refactor
This commit is contained in:
@@ -19,7 +19,7 @@ export interface CommonIconProps {
|
|||||||
size?: string | number;
|
size?: string | number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useItemIcon(props: CommonIconProps) {
|
export function useItemIconBase(props: CommonIconProps) {
|
||||||
const style = computed<Record<IconItemStyleName, IconItemStyleValue>>(() => {
|
const style = computed<Record<IconItemStyleName, IconItemStyleValue>>(() => {
|
||||||
let defaultColor = 'var(--default-icon-color)';
|
let defaultColor = 'var(--default-icon-color)';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { type CommonIconProps, useItemIcon } from '@/components/base/ItemIcon.ts';
|
import { type CommonIconProps, useItemIconBase } from '@/components/base/ItemIconBase.ts';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
mdiEyeOffOutline
|
mdiEyeOffOutline
|
||||||
@@ -25,7 +25,7 @@ interface DesktopItemIconProps extends CommonIconProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<DesktopItemIconProps>();
|
const props = defineProps<DesktopItemIconProps>();
|
||||||
const { style, getAccountIcon, getCategoryIcon } = useItemIcon(props);
|
const { style, getAccountIcon, getCategoryIcon } = useItemIconBase(props);
|
||||||
|
|
||||||
const icons = {
|
const icons = {
|
||||||
hide: mdiEyeOffOutline
|
hide: mdiEyeOffOutline
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { type CommonIconProps, useItemIcon } from '@/components/base/ItemIcon.ts';
|
import { type CommonIconProps, useItemIconBase } from '@/components/base/ItemIconBase.ts';
|
||||||
|
|
||||||
const props = defineProps<CommonIconProps>();
|
const props = defineProps<CommonIconProps>();
|
||||||
const { style, getAccountIcon, getCategoryIcon } = useItemIcon(props);
|
const { style, getAccountIcon, getCategoryIcon } = useItemIconBase(props);
|
||||||
|
|
||||||
const f7IconValue = computed<string>(() => {
|
const f7IconValue = computed<string>(() => {
|
||||||
if (props.iconType === 'fixed-f7') {
|
if (props.iconType === 'fixed-f7') {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { getMapWebsite } from '@/lib/map/index.ts';
|
|||||||
import { getLicense, getThirdPartyLicenses } from '@/lib/licenses.ts';
|
import { getLicense, getThirdPartyLicenses } from '@/lib/licenses.ts';
|
||||||
import { getVersion, getBuildTime } from '@/lib/version.ts';
|
import { getVersion, getBuildTime } from '@/lib/version.ts';
|
||||||
|
|
||||||
export function useAboutPage() {
|
export function useAboutPageBase() {
|
||||||
const { tt, formatUnixTimeToLongDateTime } = useI18n();
|
const { tt, formatUnixTimeToLongDateTime } = useI18n();
|
||||||
|
|
||||||
const exchangeRatesStore = useExchangeRatesStore();
|
const exchangeRatesStore = useExchangeRatesStore();
|
||||||
@@ -121,8 +121,8 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from '@/locales/helpers.ts';
|
import { useI18n } from '@/locales/helpers.ts';
|
||||||
import { useAboutPage } from '@/views/base/AboutPage.ts';
|
import { useAboutPageBase } from '@/views/base/AboutPageBase.ts';
|
||||||
|
|
||||||
const { tt } = useI18n();
|
const { tt } = useI18n();
|
||||||
const { version, buildTime, exchangeRatesData, mapProviderName, mapProviderWebsite, licenseLines, thirdPartyLicenses } = useAboutPage();
|
const { version, buildTime, exchangeRatesData, mapProviderName, mapProviderWebsite, licenseLines, thirdPartyLicenses } = useAboutPageBase();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -59,10 +59,10 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useI18n } from '@/locales/helpers.ts';
|
import { useI18n } from '@/locales/helpers.ts';
|
||||||
import { useAboutPage } from '@/views/base/AboutPage.ts';
|
import { useAboutPageBase } from '@/views/base/AboutPageBase.ts';
|
||||||
|
|
||||||
const { tt } = useI18n();
|
const { tt } = useI18n();
|
||||||
const { version, buildTime, exchangeRatesData, mapProviderName, mapProviderWebsite, licenseLines, thirdPartyLicenses } = useAboutPage();
|
const { version, buildTime, exchangeRatesData, mapProviderName, mapProviderWebsite, licenseLines, thirdPartyLicenses } = useAboutPageBase();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user