doc: update HourlyTemp component

This commit is contained in:
Leon Xu committed 2022-02-22 14:24:55 -08:00
1 parent 7b76325dcf
commit d34065966a
1 file changed
+49 -3
+49 -3
View File
@@ -1,12 +1,58 @@
<template>
<section></section>
<div class="hour">
<span>{{
new Date(this.time.dt * 1000).toLocaleString("zh-CN", { hour: "numeric" })
}}</span>
<span>
<img
:src="
require(`../../public/conditions/${this.time.weather[0].icon}.svg`)
"
alt=""
/>
</span>
<span>{{ Math.round(this.time.temp) }}&deg;</span>
</div>
</template>
<script>
export default {
name: "HourlyTemp",
props: ["time"],
};
</script>
<style>
</style>
<style lang="scss" scoped>
.hour {
color: #fff;
display: flex;
flex-direction: column;
text-align: center;
min-width: 45px;
margin-right: 30px;
}
img {
width: auto;
height: 22px;
display: block;
}
span {
display: block;
align-self: center;
}
span:nth-child(1) {
font-weight: 300;
margin-bottom: 12px;
}
span:nth-child(2) {
margin-bottom: 12px;
}
span:nth-child(3) {
font-weight: 500;
}
</style>