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",
"",
- "\t",
+ "\t",
+ "\t\t...",
+ "\t
",
"\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")
diff --git a/src/layouts/components/TagsView/index.vue b/src/layouts/components/TagsView/index.vue
index fcde5c7c..8f75e26b 100644
--- a/src/layouts/components/TagsView/index.vue
+++ b/src/layouts/components/TagsView/index.vue
@@ -154,7 +154,7 @@ watch(visible, (value) => {
initTags()
-/** 监听路由变化 */
+// 监听路由变化
listenerRouteChange((route) => {
addTags(route)
}, true)
diff --git a/src/layouts/index.vue b/src/layouts/index.vue
index bc9b472f..06ce3565 100644
--- a/src/layouts/index.vue
+++ b/src/layouts/index.vue
@@ -12,7 +12,7 @@ import LeftMode from "./LeftMode.vue"
import LeftTopMode from "./LeftTopMode.vue"
import TopMode from "./TopMode.vue"
-/** Layout 布局响应式 */
+// Layout 布局响应式
useResize()
const { setWatermark, clearWatermark } = useWatermark()
@@ -29,7 +29,7 @@ watchEffect(() => {
})
// #endregion
-/** 开启或关闭系统水印 */
+// 开启或关闭系统水印
watchEffect(() => {
showWatermark.value ? setWatermark(import.meta.env.VITE_APP_TITLE) : clearWatermark()
})
diff --git a/src/main.ts b/src/main.ts
index 13e1216a..0a8fa734 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -19,11 +19,11 @@ import "@/styles/index.scss"
const app = createApp(App)
-/** 加载插件 */
+// 加载插件
loadPlugins(app)
-/** 加载全局 SVG */
+// 加载全局 SVG
loadSvg(app)
-/** 加载自定义指令 */
+// 加载自定义指令
loadDirectives(app)
app.use(pinia).use(router)
diff --git a/src/plugins/element-plus-icon/index.ts b/src/plugins/element-plus-icon/index.ts
index 238153d7..9a74db41 100644
--- a/src/plugins/element-plus-icon/index.ts
+++ b/src/plugins/element-plus-icon/index.ts
@@ -2,7 +2,7 @@ import type { App } from "vue"
import * as ElementPlusIconsVue from "@element-plus/icons-vue"
export function loadElementPlusIcon(app: App) {
- /** 注册所有 Element Plus Icon */
+ // 注册所有 Element Plus Icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
diff --git a/src/plugins/element-plus/index.ts b/src/plugins/element-plus/index.ts
index a5121382..42a3fa8d 100644
--- a/src/plugins/element-plus/index.ts
+++ b/src/plugins/element-plus/index.ts
@@ -2,6 +2,6 @@ import type { App } from "vue"
import ElementPlus from "element-plus"
export function loadElementPlus(app: App) {
- /** Element Plus 组件完整引入 */
+ // Element Plus 组件完整引入
app.use(ElementPlus)
}
diff --git a/src/plugins/vxe-table/index.ts b/src/plugins/vxe-table/index.ts
index a27cd9e6..6e7ce770 100644
--- a/src/plugins/vxe-table/index.ts
+++ b/src/plugins/vxe-table/index.ts
@@ -6,15 +6,15 @@ import VXETablePluginElement from "vxe-table-plugin-element"
VXETable.use(VXETablePluginElement)
-/** 全局默认参数 */
+// 全局默认参数
VXETable.setConfig({
- /** 全局尺寸 */
+ // 全局尺寸
size: "medium",
- /** 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡 */
+ // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
zIndex: 9999,
- /** 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据 */
+ // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
version: 0,
- /** 全局 loading 提示内容,如果为 null 则不显示文本 */
+ // 全局 loading 提示内容,如果为 null 则不显示文本
loadingText: null,
table: {
showHeader: true,
@@ -39,7 +39,7 @@ VXETable.setConfig({
},
pager: {
// size: "medium",
- /** 配套的样式 */
+ // 配套的样式
perfect: false,
pageSize: 10,
pagerCount: 7,
@@ -61,6 +61,6 @@ VXETable.setConfig({
})
export function loadVxeTable(app: App) {
- /** Vxe Table 组件完整引入 */
+ // Vxe Table 组件完整引入
app.use(VXETable)
}
diff --git a/src/router/index.ts b/src/router/index.ts
index 0fc072e1..f3a028e7 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -266,7 +266,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
title: "权限",
svgIcon: "lock",
roles: ["admin", "editor"], // 可以在根路由中设置角色
- alwaysShow: true // 将始终显示根菜单
+ alwaysShow: true
},
children: [
{
diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts
index c2001eda..98e1c222 100644
--- a/src/store/modules/app.ts
+++ b/src/store/modules/app.ts
@@ -23,7 +23,7 @@ export const useAppStore = defineStore("app", () => {
/** 设备类型 */
const device = ref(DeviceEnum.Desktop)
- /** 监听侧边栏 opened 状态 */
+ // 监听侧边栏 opened 状态
watch(
() => sidebar.opened,
opened => handleSidebarStatus(opened)
diff --git a/src/store/modules/tags-view.ts b/src/store/modules/tags-view.ts
index 8a2c240d..95a72679 100644
--- a/src/store/modules/tags-view.ts
+++ b/src/store/modules/tags-view.ts
@@ -12,7 +12,7 @@ export const useTagsViewStore = defineStore("tags-view", () => {
const visitedViews = ref(cacheTagsView ? getVisitedViews() : [])
const cachedViews = ref(cacheTagsView ? getCachedViews() : [])
- /** 缓存标签栏数据 */
+ // 缓存标签栏数据
watchEffect(() => {
setVisitedViews(visitedViews.value)
setCachedViews(cachedViews.value)
diff --git a/src/styles/element-plus.css b/src/styles/element-plus.css
index 6337bc19..be36db29 100644
--- a/src/styles/element-plus.css
+++ b/src/styles/element-plus.css
@@ -4,9 +4,9 @@
* 也可以打开浏览器控制台选择元素,查看要覆盖的变量名
*/
-/** 基础颜色 */
+/* 基础颜色 */
html.dark-blue {
- /** color-primary */
+ /* color-primary */
--el-color-primary: #00bb99;
--el-color-primary-light-3: #00bb99b3;
--el-color-primary-light-5: #00bb9980;
@@ -14,7 +14,7 @@ html.dark-blue {
--el-color-primary-light-8: #00bb9933;
--el-color-primary-light-9: #00bb991a;
--el-color-primary-dark-2: #00bb99;
- /** color-success */
+ /* color-success */
--el-color-success: #67c23a;
--el-color-success-light-3: #67c23ab3;
--el-color-success-light-5: #67c23a80;
@@ -22,7 +22,7 @@ html.dark-blue {
--el-color-success-light-8: #67c23a33;
--el-color-success-light-9: #67c23a1a;
--el-color-success-dark-2: #67c23a;
- /** color-warning */
+ /* color-warning */
--el-color-warning: #e6a23c;
--el-color-warning-light-3: #e6a23cb3;
--el-color-warning-light-5: #e6a23c80;
@@ -30,7 +30,7 @@ html.dark-blue {
--el-color-warning-light-8: #e6a23c33;
--el-color-warning-light-9: #e6a23c1a;
--el-color-warning-dark-2: #e6a23c;
- /** color-danger */
+ /* color-danger */
--el-color-danger: #f56c6c;
--el-color-danger-light-3: #f56c6cb3;
--el-color-danger-light-5: #f56c6c80;
@@ -38,7 +38,7 @@ html.dark-blue {
--el-color-danger-light-8: #f56c6c33;
--el-color-danger-light-9: #f56c6c1a;
--el-color-danger-dark-2: #f56c6c;
- /** color-error */
+ /* color-error */
--el-color-error: #f56c6c;
--el-color-error-light-3: #f56c6cb3;
--el-color-error-light-5: #f56c6c80;
@@ -46,7 +46,7 @@ html.dark-blue {
--el-color-error-light-8: #f56c6c33;
--el-color-error-light-9: #f56c6c1a;
--el-color-error-dark-2: #f56c6c;
- /** color-info */
+ /* color-info */
--el-color-info: #909399;
--el-color-info-light-3: #909399b3;
--el-color-info-light-5: #90939980;
@@ -54,20 +54,20 @@ html.dark-blue {
--el-color-info-light-8: #90939933;
--el-color-info-light-9: #9093991a;
--el-color-info-dark-2: #909399;
- /** text-color */
+ /* text-color */
--el-text-color-primary: #e5eaf3;
--el-text-color-regular: #cfd3dc;
--el-text-color-secondary: #a3a6ad;
--el-text-color-placeholder: #8d9095;
--el-text-color-disabled: #6c6e72;
- /** border-color */
+ /* border-color */
--el-border-color-darker: #003380;
--el-border-color-dark: #003380;
--el-border-color: #003380;
--el-border-color-light: #003380;
--el-border-color-lighter: #003380;
--el-border-color-extra-light: #003380;
- /** fill-color */
+ /* fill-color */
--el-fill-color-darker: #002b6b;
--el-fill-color-dark: #002b6b;
--el-fill-color: #002b6b;
@@ -75,16 +75,16 @@ html.dark-blue {
--el-fill-color-lighter: #002359;
--el-fill-color-blank: #001b44;
--el-fill-color-extra-light: #001b44;
- /** bg-color */
+ /* bg-color */
--el-bg-color-page: #001535;
--el-bg-color: #001b44;
--el-bg-color-overlay: #002359;
- /** mask-color */
+ /* mask-color */
--el-mask-color: rgba(0, 0, 0, 0.5);
--el-mask-color-extra-light: rgba(0, 0, 0, 0.3);
}
-/** button */
+/* button */
html.dark-blue .el-button {
--el-button-disabled-text-color: rgba(255, 255, 255, 0.5);
}
diff --git a/src/styles/element-plus.scss b/src/styles/element-plus.scss
index c7ddc4d3..a3fba0cd 100644
--- a/src/styles/element-plus.scss
+++ b/src/styles/element-plus.scss
@@ -1,4 +1,4 @@
-/** 自定义 Element Plus 样式 */
+// 自定义 Element Plus 样式
// 卡片
.el-card {
diff --git a/src/styles/mixins.scss b/src/styles/mixins.scss
index 87d4e17c..758e6e5d 100644
--- a/src/styles/mixins.scss
+++ b/src/styles/mixins.scss
@@ -1,4 +1,4 @@
-/** 清除浮动 */
+// 清除浮动
%clearfix {
&::after {
content: "";
@@ -7,7 +7,7 @@
}
}
-/** 美化原生滚动条 */
+// 美化原生滚动条
%scrollbar {
// 整个滚动条
&::-webkit-scrollbar {
@@ -31,7 +31,7 @@
}
}
-/** 文本溢出时显示省略号 */
+// 文本溢出时显示省略号
%ellipsis {
// 隐藏溢出的文本
overflow: hidden;
diff --git a/src/styles/theme/core/element-plus.scss b/src/styles/theme/core/element-plus.scss
index 2c3db6e7..54061a73 100644
--- a/src/styles/theme/core/element-plus.scss
+++ b/src/styles/theme/core/element-plus.scss
@@ -1,4 +1,4 @@
-/** Element Plus 相关 */
+// Element Plus 相关
// 侧边栏的 item 的 popper
.el-popper {
diff --git a/src/styles/theme/core/layouts.scss b/src/styles/theme/core/layouts.scss
index 62dcfe3c..92d3e621 100644
--- a/src/styles/theme/core/layouts.scss
+++ b/src/styles/theme/core/layouts.scss
@@ -1,4 +1,4 @@
-/** Layout 相关 */
+// Layout 相关
.app-wrapper {
// 侧边栏
diff --git a/src/styles/theme/dark-blue/variables.scss b/src/styles/theme/dark-blue/variables.scss
index 4fa3b6db..e65ab926 100644
--- a/src/styles/theme/dark-blue/variables.scss
+++ b/src/styles/theme/dark-blue/variables.scss
@@ -1,4 +1,4 @@
-/** dark-blue 主题下的变量 */
+// dark-blue 主题下的变量
// 主题名称
$theme-name: "dark-blue";
diff --git a/src/styles/theme/dark/variables.scss b/src/styles/theme/dark/variables.scss
index e8f4020c..df0a354f 100644
--- a/src/styles/theme/dark/variables.scss
+++ b/src/styles/theme/dark/variables.scss
@@ -1,4 +1,4 @@
-/** dark 主题下的变量 */
+// dark 主题下的变量
// 主题名称
$theme-name: "dark";
diff --git a/src/styles/variables.css b/src/styles/variables.css
index 9f0caf3c..32ec8709 100644
--- a/src/styles/variables.css
+++ b/src/styles/variables.css
@@ -1,10 +1,10 @@
-/** 全局 CSS 变量,这种变量不仅可以在 CSS 和 SCSS 中使用,还可以导入到 JS 中使用 */
+/* 全局 CSS 变量,这种变量不仅可以在 CSS 和 SCSS 中使用,还可以导入到 JS 中使用 */
:root {
- /** Body */
+ /* Body */
--v3-body-text-color: var(--el-text-color-primary);
--v3-body-bg-color: var(--el-bg-color-page);
- /** Header 区域 = NavigationBar 组件 + TagsView 组件 */
+ /* Header 区域 = NavigationBar 组件 + TagsView 组件 */
--v3-header-height: calc(
var(--v3-navigationbar-height) + var(--v3-tagsview-height) + var(--v3-header-border-bottom-width)
);
@@ -12,10 +12,10 @@
--v3-header-box-shadow: var(--el-box-shadow-lighter);
--v3-header-border-bottom-width: 1px;
--v3-header-border-bottom: var(--v3-header-border-bottom-width) solid var(--el-fill-color);
- /** NavigationBar 组件 */
+ /* NavigationBar 组件 */
--v3-navigationbar-height: 50px;
--v3-navigationbar-text-color: var(--el-text-color-regular);
- /** Sidebar 组件(左侧模式全部生效、顶部模式全部不生效、混合模式非颜色部分生效) */
+ /* Sidebar 组件(左侧模式全部生效、顶部模式全部不生效、混合模式非颜色部分生效) */
--v3-sidebar-width: 220px;
--v3-sidebar-hide-width: 58px;
--v3-sidebar-border-right: 1px solid var(--el-fill-color);
@@ -25,7 +25,7 @@
--v3-sidebar-menu-hover-bg-color: #409eff10;
--v3-sidebar-menu-text-color: #cfd3dc;
--v3-sidebar-menu-active-text-color: #ffffff;
- /** TagsView 组件 */
+ /* TagsView 组件 */
--v3-tagsview-height: 34px;
--v3-tagsview-text-color: var(--el-text-color-regular);
--v3-tagsview-tag-active-text-color: #ffffff;
@@ -41,32 +41,32 @@
--v3-tagsview-contextmenu-bg-color: var(--el-bg-color-overlay);
--v3-tagsview-contextmenu-hover-bg-color: var(--el-fill-color);
--v3-tagsview-contextmenu-box-shadow: var(--el-box-shadow);
- /** Hamburger 组件 */
+ /* Hamburger 组件 */
--v3-hamburger-text-color: var(--el-text-color-primary);
- /** RightPanel 组件 */
+ /* RightPanel 组件 */
--v3-rightpanel-button-bg-color: #001428;
}
-/** 内容区放大时,将不需要的组件隐藏 */
+/* 内容区放大时,将不需要的组件隐藏 */
body.content-large {
- /** Header 区域 = TagsView 组件 */
+ /* Header 区域 = TagsView 组件 */
--v3-header-height: var(--v3-tagsview-height);
- /** NavigationBar 组件 */
+ /* NavigationBar 组件 */
--v3-navigationbar-height: 0px;
- /** Sidebar 组件 */
+ /* Sidebar 组件 */
--v3-sidebar-width: 0px;
--v3-sidebar-hide-width: 0px;
}
-/** 内容区全屏时,将不需要的组件隐藏 */
+/* 内容区全屏时,将不需要的组件隐藏 */
body.content-full {
- /** Header 区域 */
+ /* Header 区域 */
--v3-header-height: 0px;
- /** NavigationBar 组件 */
+ /* NavigationBar 组件 */
--v3-navigationbar-height: 0px;
- /** Sidebar 组件 */
+ /* Sidebar 组件 */
--v3-sidebar-width: 0px;
--v3-sidebar-hide-width: 0px;
- /** TagsView 组件 */
+ /* TagsView 组件 */
--v3-tagsview-height: 0px;
}
diff --git a/src/styles/view-transition.scss b/src/styles/view-transition.scss
index 7b05bbab..72d5975a 100644
--- a/src/styles/view-transition.scss
+++ b/src/styles/view-transition.scss
@@ -1,4 +1,4 @@
-/** 控制切换主题时的动画效果(只在较新的浏览器上生效,例如 Chrome 111+) */
+// 控制切换主题时的动画效果(只在较新的浏览器上生效,例如 Chrome 111+)
::view-transition-old(root) {
animation: none;
diff --git a/src/styles/vxe-table.scss b/src/styles/vxe-table.scss
index 684cf39f..e77f21b0 100644
--- a/src/styles/vxe-table.scss
+++ b/src/styles/vxe-table.scss
@@ -1,4 +1,4 @@
-/** 自定义 Vxe Table 样式 */
+// 自定义 Vxe Table 样式
.vxe-grid {
// 表单
diff --git a/src/utils/cache/cookies.ts b/src/utils/cache/cookies.ts
index c7aa50f8..63fdc5d4 100644
--- a/src/utils/cache/cookies.ts
+++ b/src/utils/cache/cookies.ts
@@ -1,4 +1,4 @@
-/** 统一处理 Cookie */
+// 统一处理 Cookie
import CacheKey from "@/constants/cache-key"
import Cookies from "js-cookie"
diff --git a/src/utils/cache/local-storage.ts b/src/utils/cache/local-storage.ts
index 83638d4c..b4ec7069 100644
--- a/src/utils/cache/local-storage.ts
+++ b/src/utils/cache/local-storage.ts
@@ -1,4 +1,4 @@
-/** 统一处理 localStorage */
+// 统一处理 localStorage
import type { LayoutSettings } from "@/config/layouts"
import type { SidebarClosed, SidebarOpened } from "@/constants/app-key"
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index efab1c94..82d4535b 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -68,7 +68,7 @@ function createCode() {
})
}
-/** 初始化验证码 */
+// 初始化验证码
createCode()
diff --git a/src/views/table/element-plus/index.vue b/src/views/table/element-plus/index.vue
index 939f468e..b230e073 100644
--- a/src/views/table/element-plus/index.vue
+++ b/src/views/table/element-plus/index.vue
@@ -108,7 +108,7 @@ function resetSearch() {
}
// #endregion
-/** 监听分页参数的变化 */
+// 监听分页参数的变化
watch([() => paginationData.currentPage, () => paginationData.pageSize], getTableData, { immediate: true })
diff --git a/src/views/table/vxe-table/index.vue b/src/views/table/vxe-table/index.vue
index 521e421f..d66fd1e1 100644
--- a/src/views/table/vxe-table/index.vue
+++ b/src/views/table/vxe-table/index.vue
@@ -124,7 +124,7 @@ const xGridOpt: VxeGridProps = reactive({
/** 是否代理表单 */
form: true,
/** 是否自动加载,默认为 true */
- // autoLoad: false,
+ autoLoad: true,
props: {
total: "total"
},
@@ -155,7 +155,7 @@ const xGridOpt: VxeGridProps = reactive({
size: page.pageSize,
currentPage: page.currentPage
}
- /** 调用接口 */
+ // 调用接口
getTableDataApi(params).then(callback).catch(callback)
})
}
diff --git a/unocss.config.ts b/unocss.config.ts
index a5a561ac..f6bbb55c 100644
--- a/unocss.config.ts
+++ b/unocss.config.ts
@@ -1,16 +1,16 @@
import { defineConfig, presetAttributify, presetUno } from "unocss"
export default defineConfig({
- /** 预设 */
+ // 预设
presets: [
- /** 属性化模式 & 无值的属性模式 */
+ // 属性化模式 & 无值的属性模式
presetAttributify(),
- /** 默认预设 */
+ // 默认预设
presetUno()
],
- /** 自定义规则 */
+ // 自定义规则
rules: [["uno-padding-20", { padding: "20px" }]],
- /** 自定义快捷方式 */
+ // 自定义快捷方式
shortcuts: {
"uno-wh-full": "w-full h-full",
"uno-flex-center": "flex justify-center items-center",
diff --git a/vite.config.ts b/vite.config.ts
index 96cba6a8..61fa6ed7 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -9,50 +9,50 @@ import { loadEnv } from "vite"
import { createSvgIconsPlugin } from "vite-plugin-svg-icons"
import svgLoader from "vite-svg-loader"
-/** 配置项文档:https://cn.vitejs.dev/config */
+// 配置项文档:https://cn.vitejs.dev/config
export default ({ mode }: ConfigEnv): UserConfigExport => {
const viteEnv = loadEnv(mode, process.cwd()) as ImportMetaEnv
const { VITE_PUBLIC_PATH } = viteEnv
return {
- /** 打包时根据实际情况修改 base */
+ // 打包时根据实际情况修改 base
base: VITE_PUBLIC_PATH,
resolve: {
alias: {
- /** @ 符号指向 src 目录 */
+ // @ 符号指向 src 目录
"@": resolve(__dirname, "./src")
}
},
server: {
- /** 设置 host: true 才可以使用 Network 的形式,以 IP 访问项目 */
+ // 设置 host: true 才可以使用 Network 的形式,以 IP 访问项目
host: true, // host: "0.0.0.0"
- /** 端口号 */
+ // 端口号
port: 3333,
- /** 是否自动打开浏览器 */
+ // 是否自动打开浏览器
open: false,
- /** 跨域设置允许 */
+ // 跨域设置允许
cors: true,
- /** 端口被占用时,是否直接退出 */
+ // 端口被占用时,是否直接退出
strictPort: false,
- /** 接口代理 */
+ // 接口代理
proxy: {
"/api/v1": {
target: "https://mock.mengxuegu.com/mock/63218b5fb4c53348ed2bc212",
ws: true,
- /** 是否允许跨域 */
+ // 是否允许跨域
changeOrigin: true
}
},
- /** 预热常用文件,提高初始页面加载速度 */
+ // 预热常用文件,提高初始页面加载速度
warmup: {
clientFiles: ["./src/layouts/**/*.vue"]
}
},
build: {
- /** 单个 chunk 文件的大小超过 2048KB 时发出警告 */
+ // 单个 chunk 文件的大小超过 2048KB 时发出警告
chunkSizeWarningLimit: 2048,
- /** 禁用 gzip 压缩大小报告 */
+ // 禁用 gzip 压缩大小报告
reportCompressedSize: false,
- /** 打包后静态资源目录 */
+ // 打包后静态资源目录
assetsDir: "static",
rollupOptions: {
output: {
@@ -69,33 +69,33 @@ export default ({ mode }: ConfigEnv): UserConfigExport => {
}
}
},
- /** 混淆器 */
+ // 混淆器
esbuild:
mode === "development"
? undefined
: {
- /** 打包时移除 console.log */
+ // 打包时移除 console.log
pure: ["console.log"],
- /** 打包时移除 debugger */
+ // 打包时移除 debugger
drop: ["debugger"],
- /** 打包时移除所有注释 */
+ // 打包时移除所有注释
legalComments: "none"
},
- /** Vite 插件 */
+ // Vite 插件
plugins: [
vue(),
vueJsx(),
- /** 将 SVG 静态图转化为 Vue 组件 */
+ // 将 SVG 静态图转化为 Vue 组件
svgLoader({ defaultImport: "url" }),
- /** SVG */
+ // SVG
createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), "src/icons/svg")],
symbolId: "icon-[dir]-[name]"
}),
- /** UnoCSS */
+ // UnoCSS
UnoCSS()
],
- /** Vitest 单元测试配置:https://cn.vitest.dev/config */
+ // Vitest 单元测试配置:https://cn.vitest.dev/config
test: {
include: ["tests/**/*.test.ts"],
environment: "jsdom"