diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2ffa1f6..01a96d8 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,8 @@ { "recommendations": [ + "vue.volar", "editorconfig.editorconfig", "dbaeumer.vscode-eslint", - "vue.volar", "antfu.unocss", "vitest.explorer", "wiensss.region-highlighter" diff --git a/.vscode/settings.json b/.vscode/settings.json index a4d625a..eee18d0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { + // Use workspace TypeScript version "typescript.tsdk": "node_modules/typescript/lib", // Disable the default formatter, use eslint instead diff --git a/.vscode/vue.code-snippets b/.vscode/vue.code-snippets index 001d20f..2bc45fd 100644 --- a/.vscode/vue.code-snippets +++ b/.vscode/vue.code-snippets @@ -4,7 +4,9 @@ "body": [ "\n", "\n", "", "$1" diff --git a/README.md b/README.md index cd71298..aab275d 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ China repository: [Gitee](https://gitee.com/un-pany/v3-admin-vite) - **Vite**:Really fast - **Vue Router**:router - **TypeScript**:JavaScript With Syntax For Types -- **PNPM**:Faster, disk space saving package management tool +- **pnpm**:Faster, disk space saving package management tool - **Scss**:Consistent with Element Plus - **CSS variable**:Mainly controls the layout and color of the item - **ESlint**:Code verification, Code formatting diff --git a/README.zh-CN.md b/README.zh-CN.md index f0e7ae8..185717a 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -40,7 +40,7 @@ V3 Admin Vite 是一个免费开源的中后台管理系统基础解决方案, - **Vite**:真的很快 - **Vue Router**:路由路由 - **TypeScript**:JavaScript 语言的超集 -- **PNPM**:更快速的,节省磁盘空间的包管理工具 +- **pnpm**:更快速的,节省磁盘空间的包管理工具 - **Scss**:和 Element Plus 保持一致 - **CSS 变量**:主要控制项目的布局和颜色 - **ESlint**:代码校验与格式化 diff --git a/public/app-loading.css b/public/app-loading.css index 4f1346d..13fdbc7 100644 --- a/public/app-loading.css +++ b/public/app-loading.css @@ -1,4 +1,4 @@ -/** 白屏阶段会执行的 CSS 加载动画 */ +/* 白屏阶段会执行的 CSS 加载动画 */ #app-loading { position: relative; diff --git a/src/App.vue b/src/App.vue index 3cbc311..971c3a7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,12 +7,12 @@ import zhCn from "element-plus/es/locale/lang/zh-cn" // Element Plus 中文包 const { initTheme } = useTheme() const { initGreyAndColorWeakness } = useGreyAndColorWeakness() -/** 初始化主题 */ +// 初始化主题 initTheme() -/** 初始化灰色模式和色弱模式 */ +// 初始化灰色模式和色弱模式 initGreyAndColorWeakness() -/** 作者小心思 */ +// 作者小心思 ElNotification({ title: "Hello", type: "success", diff --git a/src/components/Notify/data.ts b/src/components/Notify/data.ts index 10545b1..b54b456 100644 --- a/src/components/Notify/data.ts +++ b/src/components/Notify/data.ts @@ -12,8 +12,7 @@ export const notifyData: ListItem[] = [ avatar: "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png", title: "V3 Admin Vite 上线啦", datetime: "一年前", - description: - "一个免费开源的中后台管理系统基础解决方案,基于 Vue3、TypeScript、Element Plus、Pinia 和 Vite 等主流技术" + description: "一个免费开源的中后台管理系统基础解决方案,基于 Vue3、TypeScript、Element Plus、Pinia 和 Vite 等主流技术" }, { avatar: "https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png", diff --git a/src/components/Notify/index.vue b/src/components/Notify/index.vue index 4f11051..3313623 100644 --- a/src/components/Notify/index.vue +++ b/src/components/Notify/index.vue @@ -15,9 +15,7 @@ interface DataItem { } /** 角标当前值 */ -const badgeValue = computed(() => { - return data.value.reduce((sum, item) => sum + item.list.length, 0) -}) +const badgeValue = computed(() => data.value.reduce((sum, item) => sum + item.list.length, 0)) /** 角标最大值 */ const badgeMax = 99 /** 面板宽度 */ diff --git a/src/components/SearchMenu/SearchResult.vue b/src/components/SearchMenu/SearchResult.vue index a4ad586..b6282cd 100644 --- a/src/components/SearchMenu/SearchResult.vue +++ b/src/components/SearchMenu/SearchResult.vue @@ -40,7 +40,8 @@ function getScrollTop(index: number) { const currentInstance = instance?.proxy?.$refs[`resultItemRef${index}`] as HTMLDivElement[] if (!currentInstance) return 0 const currentRef = currentInstance[0] - const scrollTop = currentRef.offsetTop + 128 // 128 = 两个 result-item (56 + 56 = 112)高度与上下 margin(8 + 8 = 16)大小之和 + // 128 = 两个 result-item (56 + 56 = 112)高度与上下 margin(8 + 8 = 16)大小之和 + const scrollTop = currentRef.offsetTop + 128 return scrollTop > scrollbarHeight.value ? scrollTop - scrollbarHeight.value : 0 } diff --git a/src/components/ThemeSwitch/index.vue b/src/components/ThemeSwitch/index.vue index fe7e22d..656da7a 100644 --- a/src/components/ThemeSwitch/index.vue +++ b/src/components/ThemeSwitch/index.vue @@ -36,11 +36,7 @@ function handleChangeTheme({ clientX, clientY }: MouseEvent, themeName: ThemeNam v-for="(theme, index) in themeList" :key="index" :disabled="activeThemeName === theme.name" - @click=" - (e: MouseEvent) => { - handleChangeTheme(e, theme.name) - } - " + @click="(e: MouseEvent) => handleChangeTheme(e, theme.name)" > {{ theme.title }} diff --git a/src/layouts/components/Hamburger/index.vue b/src/layouts/components/Hamburger/index.vue index 36c1f8a..d7d5ba7 100644 --- a/src/layouts/components/Hamburger/index.vue +++ b/src/layouts/components/Hamburger/index.vue @@ -9,7 +9,6 @@ const props = withDefaults(defineProps(), { isActive: false }) -/** Vue 3.3+ defineEmits 语法 */ const emit = defineEmits<{ toggleClick: [] }>() diff --git a/src/layouts/components/Settings/index.vue b/src/layouts/components/Settings/index.vue index 2f3b917..b7869c7 100644 --- a/src/layouts/components/Settings/index.vue +++ b/src/layouts/components/Settings/index.vue @@ -10,7 +10,7 @@ import SelectLayoutMode from "./SelectLayoutMode.vue" const { isLeft } = useLayoutMode() const settingsStore = useSettingsStore() -/** 使用 storeToRefs 将提取的属性保持其响应性 */ +// 使用 storeToRefs 将提取的属性保持其响应性 const { showTagsView, showLogo, @@ -42,7 +42,7 @@ const switchSettings = { "显示色弱模式": showColorWeakness } -/** 非左侧模式时,Header 都是 fixed 布局 */ +// 非左侧模式时,Header 都是 fixed 布局 watchEffect(() => { !isLeft.value && (fixedHeader.value = true) }) diff --git a/src/layouts/components/Sidebar/index.vue b/src/layouts/components/Sidebar/index.vue index d8cba8c..fcca44f 100644 --- a/src/layouts/components/Sidebar/index.vue +++ b/src/layouts/components/Sidebar/index.vue @@ -43,10 +43,8 @@ const sidebarMenuHoverBgColor = computed(() => { const tipLineWidth = computed(() => { return !isTop.value ? "2px" : "0px" }) -// 当为顶部模式时隐藏垂直滚动条 -const hiddenScrollbarVerticalBar = computed(() => { - return isTop.value ? "none" : "block" -}) +/** 当为顶部模式时隐藏垂直滚动条 */ +const hiddenScrollbarVerticalBar = computed(() => isTop.value ? "none" : "block")