驾驶舱

This commit is contained in:
‘937886381’
2024-05-13 13:45:33 +08:00
parent b28018a7a2
commit ad8e6972fb
4 changed files with 13 additions and 4 deletions

View File

@@ -25,6 +25,7 @@ export default {
props: {},
data() {
return {
weatherInterval:null,
isFullscreen: false,
times: null,
weather:'',
@@ -43,6 +44,9 @@ export default {
;this.getTimes()
this.getWeather()
},
destroyed() {
clearInterval(this.weatherInterval)
},
methods: {
getTimes() {
setInterval(this.getTimesInterval, 1000);
@@ -84,7 +88,7 @@ export default {
day
},
async getWeather() {
setInterval(() => {
this.weatherInterval = setInterval(() => {
fetch(`https://restapi.amap.com/v3/weather/weatherInfo?key=a20a2093715deb9bd68e423c34a2ac3c&city=110108`, {
method: 'get',
extensions: 'base',