frequi_origin/src/components/general/ProfitSymbol.vue

36 lines
800 B
Vue
Raw Normal View History

<template>
2020-09-03 04:49:10 +00:00
<div class="h-100 d-inline-block">
<div :class="isProfitable ? 'triangle-up' : 'triangle-down'"></div>
</div>
</template>
<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator';
@Component({})
export default class ProfitSymbol extends Vue {
2021-10-24 13:11:55 +00:00
@Prop({ required: true, type: Number }) profit!: number;
get isProfitable() {
2021-10-24 13:11:55 +00:00
return this.profit > 0;
}
}
</script>
2021-10-24 13:11:55 +00:00
<style scoped lang="scss">
2020-09-03 04:49:10 +00:00
.triangle-up {
width: 0;
height: 0;
border-style: solid;
border-width: 0 0.45rem 0.7rem 0.45rem;
2021-10-24 13:11:55 +00:00
border-color: transparent transparent $color-profit transparent;
2020-09-03 04:49:10 +00:00
}
.triangle-down {
width: 0;
height: 0;
border-style: solid;
border-width: 0.7rem 0.45rem 0 0.45rem;
2021-10-24 13:11:55 +00:00
border-color: $color-loss transparent transparent transparent;
2020-09-03 04:49:10 +00:00
}
</style>