frequi_origin/src/components/general/ProfitSymbol.vue

42 lines
866 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>
<script lang="ts">
2022-07-07 18:44:19 +00:00
import { defineComponent, computed } from 'vue';
2022-04-16 18:29:53 +00:00
export default defineComponent({
name: 'ProfitSymbol',
props: {
profit: { type: Number, required: true },
},
setup(props) {
const isProfitable = computed(() => {
return props.profit > 0;
});
return {
isProfitable,
};
},
});
</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>