I am trying to use a computed property to change a font awesome icon for a simple weather app using openweathermap using the conditions to change the icon. Can't figure out why it is using the else return no matter what I do.
<template>
<h2>{{ city }}</h2>
<p>{{ temp }} F°</p>
<p>{{ conditions }}</p>
<font-awesome-icon class="icon-weather" :icon="weatherIcon" />
</template>
<script>
export default {
props: ["city", "temp", "conditions"],
computed: {
weatherIcon() {
let conditions = this.conditions;
if (conditions === "snow") {
return "snowflake";
} else if (conditions === "light snow") {
return "snowflake";
} else {
return "cloud";
}
},
},
};
</script>
<style scoped>
.icon-weather {
font-size: 50px;
}
</style>
this.conditions
in log? â Naren