1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-06-10 00:34:08 +08:00

chore: update deps and lint fix

This commit is contained in:
zclzone
2026-06-01 08:40:42 +08:00
parent 6d5a67b9d3
commit c55d16a951
7 changed files with 2070 additions and 1354 deletions

View File

@@ -40,8 +40,8 @@ Vue Naive Admin 2022年2月开始开源从 1.0 到现在的 2.0,一直秉
## 极致的性能
![](https://docs.isme.top/Public/Uploads/2023-11-18/6558568b2b476.png)
![](https://docs.isme.top/Public/Uploads/2023-11-18/655853caa9ce8.png)
![性能](https://docs.isme.top/Public/Uploads/2023-11-18/6558568b2b476.png)
![性能](https://docs.isme.top/Public/Uploads/2023-11-18/655853caa9ce8.png)
## 2.0 和 1.0 区别

View File

@@ -14,41 +14,41 @@
"dependencies": {
"@arco-design/color": "^0.4.0",
"@vueuse/core": "^14.2.1",
"axios": "^1.13.5",
"dayjs": "^1.11.19",
"echarts": "^6.0.0",
"lodash-es": "^4.17.23",
"naive-ui": "^2.43.2",
"axios": "^1.16.1",
"dayjs": "^1.11.21",
"echarts": "^6.1.0",
"lodash-es": "^4.18.1",
"naive-ui": "^2.44.1",
"pinia": "^3.0.4",
"pinia-plugin-persistedstate": "^4.7.1",
"vue": "^3.5.29",
"vue": "^3.5.35",
"vue-echarts": "^8.0.1",
"vue-router": "^5.0.3",
"vue-router": "^5.1.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@antfu/eslint-config": "^7.6.1",
"@iconify/json": "^2.2.443",
"@unocss/eslint-config": "^66.6.2",
"@unocss/eslint-plugin": "^66.6.2",
"@unocss/preset-rem-to-px": "^66.6.2",
"@vitejs/plugin-vue": "^6.0.4",
"@vitejs/plugin-vue-jsx": "^5.1.4",
"eslint": "^10.0.2",
"@antfu/eslint-config": "^9.0.0",
"@iconify/json": "^2.2.481",
"@unocss/eslint-config": "^66.7.0",
"@unocss/eslint-plugin": "^66.7.0",
"@unocss/preset-rem-to-px": "^66.7.0",
"@vitejs/plugin-vue": "^6.0.7",
"@vitejs/plugin-vue-jsx": "^5.1.5",
"eslint": "^10.4.1",
"eslint-plugin-format": "^2.0.1",
"esno": "^4.8.0",
"fs-extra": "^11.3.3",
"fs-extra": "^11.3.5",
"glob": "^13.0.6",
"lint-staged": "^16.2.7",
"rollup-plugin-visualizer": "^7.0.0",
"lint-staged": "^17.0.7",
"rollup-plugin-visualizer": "^7.0.1",
"simple-git-hooks": "^2.13.1",
"taze": "^19.9.2",
"unocss": "^66.6.2",
"taze": "^19.14.1",
"unocss": "^66.7.0",
"unplugin-auto-import": "^21.0.0",
"unplugin-vue-components": "^31.0.0",
"vite": "^7.3.1",
"unplugin-vue-components": "^32.1.0",
"vite": "^8.0.14",
"vite-plugin-router-warn": "^2.0.0",
"vite-plugin-vue-devtools": "^8.0.6",
"vite-plugin-vue-devtools": "^8.1.2",
"vue3-intro-step": "^1.0.5"
},
"simple-git-hooks": {

3362
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -44,7 +44,7 @@ export function createPermissionGuard(router) {
}
const routes = router.getRoutes()
if (routes.find(route => route.name === to.name))
if (routes.some(route => route.name === to.name))
return true
// 判断是无权限还是404

View File

@@ -71,7 +71,7 @@ export const useTabStore = defineStore('tab', {
const curIndex = this.tabs.findIndex(item => item.path === curPath)
const filterTabs = this.tabs.filter((item, index) => index >= curIndex)
this.setTabs(filterTabs)
if (!filterTabs.find(item => item.path === this.activeTab)) {
if (!filterTabs.some(item => item.path === this.activeTab)) {
useRouterStore().router?.push(filterTabs[filterTabs.length - 1].path)
}
},
@@ -79,7 +79,7 @@ export const useTabStore = defineStore('tab', {
const curIndex = this.tabs.findIndex(item => item.path === curPath)
const filterTabs = this.tabs.filter((item, index) => index <= curIndex)
this.setTabs(filterTabs)
if (!filterTabs.find(item => item.path === this.activeTab.value)) {
if (!filterTabs.some(item => item.path === this.activeTab.value)) {
useRouterStore().router?.push(filterTabs[filterTabs.length - 1].path)
}
},

View File

@@ -34,7 +34,7 @@ export function throttle(fn, wait) {
let previous = 0
return function (...argArr) {
const now = +new Date()
const now = Date.now()
context = this
args = argArr
if (now - previous > wait) {

View File

@@ -23,7 +23,7 @@ class Storage {
const stringData = JSON.stringify({
value,
time: Date.now(),
expire: !isNullOrUndef(expire) ? new Date().getTime() + expire * 1000 : null,
expire: !isNullOrUndef(expire) ? Date.now() + expire * 1000 : null,
})
this.storage.setItem(this.getKey(key), stringData)
}
@@ -40,7 +40,7 @@ class Storage {
try {
const data = JSON.parse(val)
const { value, time, expire } = data
if (isNullOrUndef(expire) || expire > new Date().getTime()) {
if (isNullOrUndef(expire) || expire > Date.now()) {
return { value, time }
}
this.remove(key)