2020-09-02 18:53:59 +00:00
|
|
|
<template>
|
2021-12-23 05:42:24 +00:00
|
|
|
<div class="d-inline-block">
|
2020-09-03 04:49:10 +00:00
|
|
|
<div :class="isProfitable ? 'triangle-up' : 'triangle-down'"></div>
|
|
|
|
</div>
|
2020-09-02 18:53:59 +00:00
|
|
|
</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;
|
2020-09-02 18:53:59 +00:00
|
|
|
|
|
|
|
get isProfitable() {
|
2021-10-24 13:11:55 +00:00
|
|
|
return this.profit > 0;
|
2020-09-02 18:53:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</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;
|
2020-09-04 15:04:09 +00:00
|
|
|
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;
|
2020-09-04 15:04:09 +00:00
|
|
|
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>
|