diff --git a/src/assets/img/home/pres.png b/src/assets/img/home/pres.png new file mode 100644 index 0000000..dfcd272 Binary files /dev/null and b/src/assets/img/home/pres.png differ diff --git a/src/assets/img/home/pressdetail.png b/src/assets/img/home/pressdetail.png new file mode 100644 index 0000000..62233dc Binary files /dev/null and b/src/assets/img/home/pressdetail.png differ diff --git a/src/assets/img/home/pressimg.png b/src/assets/img/home/pressimg.png new file mode 100644 index 0000000..37eb7f7 Binary files /dev/null and b/src/assets/img/home/pressimg.png differ diff --git a/src/components/header.vue b/src/components/header.vue index 4216f82..8ba6b7e 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -161,14 +161,19 @@ export default { methods: { //跳转导航 hanldeNav(index) { - if (index == 4) { + if (index == 0) { this.$router.push({ - path: "/aboutUs", + path: "/", }); } - if (index == 0) { + if (index == 3) { this.$router.push({ - path: "/", + path: "/pressCenter", + }); + } + if (index == 4) { + this.$router.push({ + path: "/aboutUs", }); } }, diff --git a/src/main.js b/src/main.js index 534eee6..a35edf2 100644 --- a/src/main.js +++ b/src/main.js @@ -12,3 +12,6 @@ new Vue({ router, render: (h) => h(App), }).$mount("#app"); +router.afterEach((to, from, next) => { + window.scrollTo(0, 0); +}); diff --git a/src/router/index.js b/src/router/index.js index 3cd3869..ac372e0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,19 +2,31 @@ import Vue from "vue"; import VueRouter from "vue-router"; import HomeView from "../views/home.vue"; import AboutUs from "../views/aboutUs.vue"; +import PressCenter from "../views/pressCenter.vue"; +import PressDetail from "../views/pressDetail.vue"; Vue.use(VueRouter); const routes = [ { path: "/", - name: "home", + name: "首页", component: HomeView, }, { path: "/aboutUs", - name: "aboutUs", + name: "关于我们", component: AboutUs, }, + { + path: "/pressCenter", + name: "新闻中心", + component: PressCenter, + }, + { + path: "/pressDetail", + name: "文字详情", + component: PressDetail, + }, ]; const router = new VueRouter({ diff --git a/src/views/home.vue b/src/views/home.vue index f18cf74..b72fb2c 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -239,6 +239,7 @@ :src="require('@/assets/img/home/content.png')" fit="fill" > +