doc: update HourlyTemp component

This commit is contained in:
Leon Xu committed 2022-02-18 18:29:56 -08:00
1 parent b62441b6ab
commit 9dd37e7da5
1 file changed
+54 -4
+54 -4
View File
@@ -1,8 +1,58 @@
<template></template>
<template>
<div class="hour">
<span>{{
new Date(this.time.dt * 1000).toLocaleString("en-us", { 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 {};
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>