doc: update HourlyTemp component
This commit is contained in:
1 parent
7b76325dcf
commit
d34065966a
1 file changed
+49
-3
@@ -1,12 +1,58 @@
|
|||||||
<template>
|
<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) }}°</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "HourlyTemp",
|
name: "HourlyTemp",
|
||||||
|
props: ["time"],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss" scoped>
|
||||||
</style>
|
.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>
|
||||||
Reference in new issue
Block a user