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

@@ -73,8 +73,8 @@ img {
width: 1200px; width: 1200px;
} }
.box-min-1200-src{ .box-min-1200-src {
min-width:1200px; min-width: 1200px;
overflow-x: scroll; overflow-x: scroll;
} }

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 = [
{ {
@@ -10,8 +21,8 @@ const routes = [
component: HomeView, component: HomeView,
meta: { meta: {
title: "首页", title: "首页",
path:'/', path: '/',
topBarShow:true topBarShow: true
} }
}, },
{ {
@@ -31,7 +42,7 @@ const routes = [
name: 'edit', name: 'edit',
component: () => import(/* webpackChunkName: "edit" */ '@/views/edit.vue'), component: () => import(/* webpackChunkName: "edit" */ '@/views/edit.vue'),
meta: { meta: {
path:'/edit' path: '/edit'
} }
}, },
@@ -41,8 +52,8 @@ const routes = [
component: () => import(/* webpackChunkName: "user" */ '@/views/user.vue'), component: () => import(/* webpackChunkName: "user" */ '@/views/user.vue'),
meta: { meta: {
title: "我的", title: "我的",
path:'/user', path: '/user',
topBarShow:true topBarShow: true
} }
}, },
{ {
@@ -51,7 +62,7 @@ const routes = [
component: () => import(/* webpackChunkName: "detail" */ '@/views/detail.vue'), component: () => import(/* webpackChunkName: "detail" */ '@/views/detail.vue'),
meta: { meta: {
title: "详情", title: "详情",
path:'/detail', path: '/detail',
} }
}, },
{//个人房源 {//个人房源
@@ -59,8 +70,8 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/person.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/person.vue'),
meta: { meta: {
title: '个人房源', title: '个人房源',
path:'/personHousing', path: '/personHousing',
topBarShow:true topBarShow: true
} }
}, },
{//中介房源 {//中介房源
@@ -68,8 +79,8 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/intermediary.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/intermediary.vue'),
meta: { meta: {
title: '中介房源', title: '中介房源',
path:'/intermediaryHousing', path: '/intermediaryHousing',
topBarShow:true topBarShow: true
} }
}, },
{//求房源 {//求房源
@@ -77,8 +88,8 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/needHousing.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/needHousing.vue'),
meta: { meta: {
title: '求房源', title: '求房源',
path:'/needHousing', path: '/needHousing',
topBarShow:true topBarShow: true
} }
}, },
{//搜索 {//搜索
@@ -86,7 +97,7 @@ const routes = [
component: () => import(/* webpackChunkName: "seachPage" */ '@/views/seachIndex.vue'), component: () => import(/* webpackChunkName: "seachPage" */ '@/views/seachIndex.vue'),
meta: { meta: {
title: '搜索', title: '搜索',
path:'/seachPage' path: '/seachPage'
} }
}, },
{ {
@@ -94,8 +105,8 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/apartment.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/apartment.vue'),
meta: { meta: {
title: "品牌公寓", title: "品牌公寓",
path:'/apartment', path: '/apartment',
topBarShow:true topBarShow: true
} }
}, },
{ {
@@ -103,7 +114,7 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/apartmentDetail.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/apartmentDetail.vue'),
meta: { meta: {
title: "品牌公寓详情", title: "品牌公寓详情",
path:'/apartmentDetail' path: '/apartmentDetail'
} }
} }
] ]
@@ -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