|
|
@ -1,19 +1,28 @@ |
|
|
|
<template> |
|
|
|
<div class="header-container"> |
|
|
|
<div class="header-title"><h2>东西湖区图书馆</h2></div> |
|
|
|
<div class="header-text header-weather">晴 20℃~30℃</div> |
|
|
|
<div class="header-text header-date">2022年9月21日 14:25:30</div> |
|
|
|
<div class="header-text header-weather"> |
|
|
|
<!-- 天气api: https://www.tianqi.com/plugin --> |
|
|
|
<iframe id="weather" width="210" scrolling="no" height="30" frameborder="0" allowtransparency="true" src="https://i.tianqi.com?c=code&id=34&color=%23FFFFFF&icon=1&py=wuhan&site=24" /> |
|
|
|
</div> |
|
|
|
<div class="header-text header-date">{{ nowDate }}</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { getCurrentTime } from '@/utils/index' |
|
|
|
export default { |
|
|
|
name: 'Header', |
|
|
|
data() { |
|
|
|
return { |
|
|
|
nowDate: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.timer = setInterval(() => { |
|
|
|
this.nowDate = getCurrentTime() |
|
|
|
}, 1000) |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|