doc: update AdditionalInfo component

This commit is contained in:
Leon Xu committed 2022-02-22 15:02:26 -08:00
1 parent 4da86e364c
commit c74d2e199a
1 file changed
+65 -3
+65 -3
View File
@@ -1,12 +1,74 @@
<template>
<section></section>
<section class="additional-info container">
<div>
<span>日出</span>
<span>{{
new Date(this.currentWeather.sys.sunrise * 1000).toLocaleString(
"zh-cn",
{ timeStyle: "short" }
)
}}</span>
</div>
<div>
<span>日落</span>
<span>{{
new Date(this.currentWeather.sys.sunset * 1000).toLocaleString(
"zh-cn",
{ timeStyle: "short" }
)
}}</span>
</div>
<div>
<span>湿度</span>
<span>{{ this.currentWeather.main.humidity }} %</span>
</div>
<div>
<span>云量</span>
<span>{{ this.currentWeather.clouds.all }} %</span>
</div>
<div>
<span>风速</span>
<span>{{ Math.round(this.currentWeather.wind.speed) }} km/h</span>
</div>
<div>
<span>气压</span>
<span>{{ this.currentWeather.main.pressure }} hPa</span>
</div>
</section>
</template>
<script>
export default {
name: "AdditionalInfo",
props: ["currentWeather"],
};
</script>
<style>
</style>
<style lang="scss" scoped>
.additional-info {
padding: 30px 20px;
display: flex;
flex-wrap: wrap;
color: #fff;
> div {
display: flex;
flex-direction: column;
flex-basis: 50%;
margin-bottom: 20px;
span:nth-child(1) {
font-size: 12px;
margin-bottom: 8px;
}
span:nth-child(2) {
font-weight: 600;
}
}
div:nth-child(5),
div:nth-child(6) {
margin-bottom: 0;
}
}
</style>