frequi_origin/src/components/general/ProfitSymbol.vue

32 lines
701 B
Vue
Raw Normal View History

<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>
</template>
2022-12-17 19:08:19 +00:00
<script setup lang="ts">
const props = defineProps({
profit: { type: Number, required: true },
});
const isProfitable = computed(() => {
return props.profit > 0;
2022-04-16 18:29:53 +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;
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>