sotlas-frontend/src/components/AltitudeLabel.vue

27 wiersze
538 B
Vue
Czysty Wina Historia

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<template>
<span :class="{ altitude: true }">{{ displayAltitude }}</span>
</template>
<script>
export default {
name: 'AltitudeLabel',
props: {
altitude: Number,
altitudeFt: Number
},
computed: {
displayAltitude () {
if (this.$store.state.altitudeUnits === 'ft') {
if (this.altitudeFt) {
return this.altitudeFt + ' ft'
} else {
return Math.round(this.altitude * 3.28084) + ' ft'
}
} else {
return this.altitude + ' m'
}
}
}
}
</script>