longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
    <div class="weather-list-item">
        <div class="item-title">{{ week }}{{ dayString }}</div>
        <div class="item-body">
            {{ weather }}
        </div>
        <div class="item-body">
            {{ temperature }}
        </div>
    </div>
</template>
 
<script>
import getWeek from "@/assets/js/tools/getWeek";
 
export default {
    name: "weatherListItem",
    props: {
        value: {
            type: Number,
            default: 0,
        },
        date: {
            type: String,
            default: ""
        },
        temperature: {
            type: String,
            default: ""
        },
        weather: {
            type: String,
            default: ""
        },
    },
    data() {
        return {}
    },
    methods: {
 
    },
    computed: {
        week() {
            let date = this.date;
            return getWeek(date);
        },
        dayString() {
            let str = "";
            if(this.value == 0) {
                str = "(明天)";
            }
            if(this.value == 1) {
                str = "(后天)";
            }
            return str;
        }
    },
}
</script>
 
<style scoped>
.weather-list-item {
    display: inline-block;
    padding: 16px;
}
.item-title {
    font-weight: bold;
}
.item-body {
    padding: 4px 0;
}
</style>