frequi_origin/src/components/ftbot/ProfitSymbol.vue

40 lines
922 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';
import { Trade } from '@/types';
@Component({})
export default class ProfitSymbol extends Vue {
@Prop({ required: true }) trade!: Trade;
get isProfitable() {
console.log(this.trade);
2020-09-03 04:49:10 +00:00
const res = (this.trade.close_profit ?? 0) > 0 || (this.trade.current_profit ?? 0) > 0;
console.log(res);
return res;
}
}
</script>
2020-09-03 04:49:10 +00:00
<style scoped>
.triangle-up {
width: 0;
height: 0;
border-style: solid;
border-width: 0 0.5rem 0.9rem 0.5rem;
border-color: transparent transparent #00db58 transparent;
}
.triangle-down {
width: 0;
height: 0;
border-style: solid;
border-width: 0.9rem 0.5rem 0 0.5rem;
border-color: #ff0000 transparent transparent transparent;
}
</style>