Files
sweet-hut-ui/src/components/Common/WeatherIcon.vue
2025-10-08 22:06:39 +08:00

21 lines
649 B
Vue

<template>
<svg-icon v-if="props.weather.includes('晴')" name="weather-sunny" />
<svg-icon v-else-if="props.weather.includes('多云')" name="weather-cloudy" />
<svg-icon v-else-if="props.weather.includes('雨')" name="weather-rainy" />
<svg-icon v-else-if="props.weather.includes('雪')" name="weather-snowy" />
<svg-icon v-else-if="props.weather.includes('雾')" name="weather-smog" />
<svg-icon v-else name="weather-cloudy" />
</template>
<script setup lang="ts">
import { SvgIcon } from 'vue3-common'
import { defineProps } from 'vue'
const props = defineProps({
weather: {
required: true,
type: String
}
})
</script>