doc: update AdditionalInfo component
This commit is contained in:
1 parent
4da86e364c
commit
c74d2e199a
1 file changed
+65
-3
@@ -1,12 +1,74 @@
|
|||||||
<template>
|
<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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "AdditionalInfo",
|
name: "AdditionalInfo",
|
||||||
|
props: ["currentWeather"],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss" scoped>
|
||||||
</style>
|
.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>
|
||||||
Reference in new issue
Block a user