Commit 1c17b3b0 by zsh

update

parent 8b7e48a7
<template> <template>
<header id="header"> <header id="header">
<div class="logo"> <div class="logo">
<img src="./images/logo.png" alt="logo"> <img src="./images/logo.png" alt="科艺logo"><span class="logo-desc">数字化管理平台</span>
</div> </div>
<h2 class="title"><span>{{ currPageTitle }}</span></h2> <h2 class="title"><span>{{ currPageTitle }}</span></h2>
<div class="date"> <div class="date">
...@@ -18,17 +18,17 @@ let timerId = null ...@@ -18,17 +18,17 @@ let timerId = null
export default { export default {
data () { data () {
return { return {
currPageTitle: '',
fullDate: '', fullDate: '',
fullTime: '' fullTime: ''
} }
}, },
computed: { watch: {
// 当前页面名称 '$route' (oldVal = {}, newVal = {}) {
currPageTitle () { if (oldVal.path !== newVal.path) {
const { meta = {} } = this.$router.currentRoute this.getCurrRoute()
}
return meta.title || ''
} }
}, },
...@@ -36,6 +36,8 @@ export default { ...@@ -36,6 +36,8 @@ export default {
window.vm = this window.vm = this
this.getSysTime() this.getSysTime()
this.getCurrRoute()
}, },
beforeDestroy () { beforeDestroy () {
...@@ -44,6 +46,11 @@ export default { ...@@ -44,6 +46,11 @@ export default {
}, },
methods: { methods: {
getCurrRoute () {
const { meta = {} } = this.$router.currentRoute
this.currPageTitle = meta.title || ''
},
getSysTime () { getSysTime () {
const that = this const that = this
try { try {
...@@ -94,6 +101,7 @@ export default { ...@@ -94,6 +101,7 @@ export default {
line-height: @pageHeaderHeight + 4; line-height: @pageHeaderHeight + 4;
white-space: nowrap; white-space: nowrap;
text-align: center; text-align: center;
background: url('./images/header-bg.png') no-repeat center top;
> span { > span {
font-size: 34px; font-size: 34px;
...@@ -115,7 +123,7 @@ export default { ...@@ -115,7 +123,7 @@ export default {
> span { > span {
font-size: 18px; font-size: 18px;
font-family: Source Han Sans CN; font-family: 'CenturyGothic';
} }
.curr-times { .curr-times {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment