feat:重构模块
This commit is contained in:
20
src/components/Common/WeatherIcon.vue
Normal file
20
src/components/Common/WeatherIcon.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user