This commit is contained in:
A1300399510
2023-08-03 18:24:17 +08:00
parent e3fb1186ee
commit 34a8434278
6 changed files with 4120 additions and 4082 deletions

11
package-lock.json generated
View File

@@ -12,6 +12,7 @@
"core-js": "^3.8.3", "core-js": "^3.8.3",
"element-plus": "^2.3.7", "element-plus": "^2.3.7",
"masonry-layout": "^4.2.2", "masonry-layout": "^4.2.2",
"nprogress": "^0.2.0",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-meta": "^3.0.0-alpha.2", "vue-meta": "^3.0.0-alpha.2",
@@ -7208,6 +7209,11 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/nprogress": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz",
"integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA=="
},
"node_modules/nth-check": { "node_modules/nth-check": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
@@ -15847,6 +15853,11 @@
"path-key": "^2.0.0" "path-key": "^2.0.0"
} }
}, },
"nprogress": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz",
"integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA=="
},
"nth-check": { "nth-check": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",

View File

@@ -11,6 +11,7 @@
"core-js": "^3.8.3", "core-js": "^3.8.3",
"element-plus": "^2.3.7", "element-plus": "^2.3.7",
"masonry-layout": "^4.2.2", "masonry-layout": "^4.2.2",
"nprogress": "^0.2.0",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-meta": "^3.0.0-alpha.2", "vue-meta": "^3.0.0-alpha.2",

View File

@@ -24,7 +24,8 @@ import {
ElSkeletonItem, ElSkeletonItem,
ElBreadcrumb, ElBreadcrumb,
ElAffix, ElAffix,
ElConfigProvider ElConfigProvider,
ElProgress
// 其他需要的组件 // 其他需要的组件
} from 'element-plus' } from 'element-plus'
@@ -67,6 +68,7 @@ app.use(ElSkeletonItem)
app.use(ElMessage) app.use(ElMessage)
app.use(ElBreadcrumb) app.use(ElBreadcrumb)
app.use(ElAffix) app.use(ElAffix)
app.use(ElProgress)
app.use(ElConfigProvider) app.use(ElConfigProvider)

View File

@@ -2,6 +2,17 @@ import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue' import HomeView from '../views/HomeView.vue'
import { setSeoTitle } from '@/utils/util.js' import { setSeoTitle } from '@/utils/util.js'
import store from '@/store' import store from '@/store'
//导入包
import NProgress from "nprogress";
import "nprogress/nprogress.css";
NProgress.configure({
easing: "ease", // 动画方式
speed: 2500, // 递增进度条的速度
showSpinner: false, // 是否显示加载ico
trickleSpeed: 200, // 自动递增间隔
minimum: 0.9, // 初始化时的最小百分比
});
const routes = [ const routes = [
{ {
@@ -120,10 +131,18 @@ const router = createRouter({
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
//进度条开始
NProgress.start();
//随机增加进度
NProgress.inc();
next() next()
let meta = to['meta'] || {} let meta = to['meta'] || {}
let title = meta['title'] let title = meta['title']
if (title) setSeoTitle(title) if (title) setSeoTitle(title)
}) })
router.afterEach(() => {
NProgress.done();
})
export default router export default router

8131
yarn.lock

File diff suppressed because it is too large Load Diff