mirror of
https://github.com/kihashi/stardew_community_checklist.git
synced 2025-10-19 08:03:17 +00:00
Add season tag with season icons.
This commit is contained in:
parent
6479bb6b28
commit
20cd738878
@ -1,11 +1,53 @@
|
||||
<template>
|
||||
|
||||
<span class="tag" v-bind:class="seasonColor">
|
||||
<span class="icon">
|
||||
<spring-icon v-if="season === 'spring'"/>
|
||||
<summer-icon v-if="season === 'summer'"/>
|
||||
<fall-icon v-if="season === 'fall'"/>
|
||||
<winter-icon v-if="season === 'winter'"/>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "season-tag"
|
||||
import Seasons from '@/assets/game_data/seasons.json'
|
||||
import SpringIcon from 'mdi-vue/FlowerIcon'
|
||||
import SummerIcon from 'mdi-vue/WhiteBalanceSunnyIcon'
|
||||
import FallIcon from 'mdi-vue/LeafIcon'
|
||||
import WinterIcon from 'mdi-vue/SnowflakeIcon'
|
||||
export default {
|
||||
name: 'season-tag',
|
||||
props: {
|
||||
season: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: 'spring',
|
||||
validator: function (value) {
|
||||
return value.toLowerCase() in Seasons
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
seasonColor: function () {
|
||||
switch (this.season) {
|
||||
case 'spring':
|
||||
return 'is-success'
|
||||
case 'summer':
|
||||
return 'is-warning'
|
||||
case 'fall':
|
||||
return 'is-danger'
|
||||
case 'winter':
|
||||
return 'is-info'
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SpringIcon,
|
||||
SummerIcon,
|
||||
FallIcon,
|
||||
WinterIcon
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user