feat: 使用prettierrc对代码进行格式化

This commit is contained in:
piexlMax(奇淼
2024-11-09 10:32:26 +08:00
parent 87a4ce17e1
commit 7d9af64f6d
139 changed files with 12677 additions and 12656 deletions
+9 -10
View File
@@ -1,19 +1,18 @@
// 本组件参考 arco-pro 的实现
// https://github.com/arco-design/arco-design-pro-vue/blob/main/arco-design-pro-vite/src/hooks/chart-option.ts
import { computed } from 'vue';
import { useAppStore } from '@/pinia';
import { computed } from 'vue'
import { useAppStore } from '@/pinia'
export default function useChartOption(sourceOption) {
const appStore = useAppStore();
const appStore = useAppStore()
const isDark = computed(() => {
return appStore.theme === 'dark';
});
return appStore.theme === 'dark'
})
const chartOption = computed(() => {
return sourceOption(isDark.value);
});
return sourceOption(isDark.value)
})
return {
chartOption,
};
chartOption
}
}
+24 -24
View File
@@ -1,35 +1,35 @@
// 本组件参考 arco-pro 的实现
// https://github.com/arco-design/arco-design-pro-vue/blob/main/arco-design-pro-vite/src/hooks/responsive.ts
import { onMounted, onBeforeMount, onBeforeUnmount } from 'vue';
import { useDebounceFn } from '@vueuse/core';
import { useAppStore } from '@/pinia';
import { addEventListen, removeEventListen } from '@/utils/event';
import { onMounted, onBeforeMount, onBeforeUnmount } from 'vue'
import { useDebounceFn } from '@vueuse/core'
import { useAppStore } from '@/pinia'
import { addEventListen, removeEventListen } from '@/utils/event'
const WIDTH = 992;
const WIDTH = 992
function queryDevice() {
const rect = document.body.getBoundingClientRect();
return rect.width - 1 < WIDTH;
const rect = document.body.getBoundingClientRect()
return rect.width - 1 < WIDTH
}
export default function useResponsive(immediate) {
const appStore = useAppStore();
function resizeHandler() {
if (!document.hidden) {
const isMobile = queryDevice();
appStore.toggleDevice(isMobile ? 'mobile' : 'desktop');
// appStore.toggleDevice(isMobile);
}
const appStore = useAppStore()
function resizeHandler() {
if (!document.hidden) {
const isMobile = queryDevice()
appStore.toggleDevice(isMobile ? 'mobile' : 'desktop')
// appStore.toggleDevice(isMobile);
}
const debounceFn = useDebounceFn(resizeHandler, 100);
onMounted(() => {
if (immediate) debounceFn();
});
onBeforeMount(() => {
addEventListen(window, 'resize', debounceFn);
});
onBeforeUnmount(() => {
removeEventListen(window, 'resize', debounceFn);
});
}
const debounceFn = useDebounceFn(resizeHandler, 100)
onMounted(() => {
if (immediate) debounceFn()
})
onBeforeMount(() => {
addEventListen(window, 'resize', debounceFn)
})
onBeforeUnmount(() => {
removeEventListen(window, 'resize', debounceFn)
})
}
+1 -1
View File
@@ -18,6 +18,6 @@ export const useWindowResize = (cb) => {
useEventListener('resize', onResize, { passive: true })
return {
width,
height,
height
}
}