mirror of
https://github.com/freqtrade/frequi.git
synced 2024-09-20 17:41:08 +00:00
trade-profit -> script setup
This commit is contained in:
parent
9e60528001
commit
9aecdc9bbf
|
@ -7,29 +7,22 @@
|
|||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
<script setup lang="ts">
|
||||
import { formatPercent, timestampms } from '@/shared/formatters';
|
||||
import { Trade } from '@/types';
|
||||
import ProfitPill from '@/components/general/ProfitPill.vue';
|
||||
|
||||
import { defineComponent, computed } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TradeProfit',
|
||||
components: { ProfitPill },
|
||||
props: {
|
||||
trade: { required: true, type: Object as () => Trade },
|
||||
},
|
||||
setup(props) {
|
||||
const profitDesc = computed((): string => {
|
||||
let profit = `Current profit: ${formatPercent(props.trade.profit_ratio)} (${
|
||||
props.trade.profit_abs
|
||||
})`;
|
||||
profit += `\nOpen since: ${timestampms(props.trade.open_timestamp)}`;
|
||||
return profit;
|
||||
});
|
||||
return { profitDesc };
|
||||
},
|
||||
const props = defineProps({
|
||||
trade: { required: true, type: Object as () => Trade },
|
||||
});
|
||||
const profitDesc = computed((): string => {
|
||||
let profit = `Current profit: ${formatPercent(props.trade.profit_ratio)} (${
|
||||
props.trade.profit_abs
|
||||
})`;
|
||||
profit += `\nOpen since: ${timestampms(props.trade.open_timestamp)}`;
|
||||
return profit;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user