From 226cdd3d1f496616686f4e6b384dc83e41bcdb4f Mon Sep 17 00:00:00 2001 From: pany <939630029@qq.com> Date: Tue, 19 Nov 2024 20:14:23 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions.json | 2 +- .vscode/settings.json | 1 + .vscode/vue.code-snippets | 4 +- README.md | 2 +- README.zh-CN.md | 2 +- public/app-loading.css | 2 +- src/App.vue | 6 +-- src/components/Notify/data.ts | 3 +- src/components/Notify/index.vue | 4 +- src/components/SearchMenu/SearchResult.vue | 3 +- src/components/ThemeSwitch/index.vue | 6 +-- src/layouts/components/Hamburger/index.vue | 1 - src/layouts/components/Settings/index.vue | 4 +- src/layouts/components/Sidebar/index.vue | 6 +-- src/layouts/components/TagsView/index.vue | 2 +- src/layouts/index.vue | 4 +- src/main.ts | 6 +-- src/plugins/element-plus-icon/index.ts | 2 +- src/plugins/element-plus/index.ts | 2 +- src/plugins/vxe-table/index.ts | 14 +++---- src/router/index.ts | 2 +- src/store/modules/app.ts | 2 +- src/store/modules/tags-view.ts | 2 +- src/styles/element-plus.css | 26 ++++++------ src/styles/element-plus.scss | 2 +- src/styles/mixins.scss | 6 +-- src/styles/theme/core/element-plus.scss | 2 +- src/styles/theme/core/layouts.scss | 2 +- src/styles/theme/dark-blue/variables.scss | 2 +- src/styles/theme/dark/variables.scss | 2 +- src/styles/variables.css | 34 ++++++++-------- src/styles/view-transition.scss | 2 +- src/styles/vxe-table.scss | 2 +- src/utils/cache/cookies.ts | 2 +- src/utils/cache/local-storage.ts | 2 +- src/views/login/index.vue | 2 +- src/views/table/element-plus/index.vue | 2 +- src/views/table/vxe-table/index.vue | 4 +- unocss.config.ts | 10 ++--- vite.config.ts | 46 +++++++++++----------- 40 files changed, 112 insertions(+), 118 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2ffa1f68..01a96d8a 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 a4d625a6..eee18d09 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 001d20f9..2bc45fd3 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 cd71298f..aab275d7 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 f0e7ae80..185717a2 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 4f1346d3..13fdbc7e 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 3cbc3119..971c3a72 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 10545b10..b54b4568 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 4f11051a..33136238 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 a4ad5867..b6282cd7 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 fe7e22d8..656da7a1 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 36c1f8af..d7d5ba7a 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 2f3b917c..b7869c7d 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 d8cba8c6..fcca44ff 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")