提交代码
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import { createWebHashHistory, createRouter } from 'vue-router'
|
||||
import {createWebHashHistory, createRouter} from 'vue-router'
|
||||
|
||||
import HomeView from '@/views/homepage/index.vue'
|
||||
|
||||
const routes = [
|
||||
{ path: '/', component: HomeView },
|
||||
{path: '/', component: HomeView},
|
||||
// ============================================ 产品中心 ============================================
|
||||
{
|
||||
path: '/product/monitorSystem',
|
||||
name: 'monitorSystem',
|
||||
name: 'MonitorSystem',
|
||||
component: () => import('@/views/product/monitorSystem.vue'),
|
||||
meta: {
|
||||
title: '低空监管体系',
|
||||
@ -15,12 +15,20 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/product/remoteDevice',
|
||||
name: 'remoteDevice',
|
||||
name: 'RemoteDevice',
|
||||
component: () => import('@/views/product/remoteDevice.vue'),
|
||||
meta: {
|
||||
title: '低空远程识别设备',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/product/detail',
|
||||
name: 'ProductDetail',
|
||||
component: () => import('@/views/product/detail.vue'),
|
||||
meta: {
|
||||
title: '产品详情',
|
||||
},
|
||||
},
|
||||
// ============================================ 服务与支撑 ============================================
|
||||
{
|
||||
path: '/services',
|
||||
@ -41,7 +49,7 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/news/detail',
|
||||
name: 'Detail',
|
||||
name: 'NewsDetail',
|
||||
component: () => import('@/views/news/detail.vue'),
|
||||
meta: {
|
||||
title: '新闻详情',
|
||||
@ -85,7 +93,7 @@ router.afterEach((to, from) => {
|
||||
// 只有路径变化时才滚动到顶部
|
||||
if (to.path !== from.path) {
|
||||
requestAnimationFrame(() => {
|
||||
window.scrollTo({ top: 0, behavior: 'instant' })
|
||||
window.scrollTo({top: 0, behavior: 'instant'})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user