Pair summary -> script setup

This commit is contained in:
Matthias 2023-02-27 20:21:45 +01:00
parent 0d59031d72
commit d09dc48944

View File

@ -25,12 +25,12 @@
</b-list-group>
</template>
<script lang="ts">
<script setup lang="ts">
import { formatPercent, timestampms } from '@/shared/formatters';
import { Lock, Trade } from '@/types';
import TradeProfit from '@/components/ftbot/TradeProfit.vue';
import ProfitPill from '@/components/general/ProfitPill.vue';
import { defineComponent, computed } from 'vue';
import { computed } from 'vue';
import { useBotStore } from '@/stores/ftbotwrapper';
interface CombinedPairList {
@ -44,20 +44,16 @@ interface CombinedPairList {
tradeCount: number;
}
export default defineComponent({
name: 'PairSummary',
components: { TradeProfit, ProfitPill },
props: {
const props = defineProps({
// TOOD: Should be string list
pairlist: { required: true, type: Array as () => string[] },
currentLocks: { required: false, type: Array as () => Lock[], default: () => [] },
trades: { required: true, type: Array as () => Trade[] },
sortMethod: { default: 'normal', type: String },
backtestMode: { required: false, default: false, type: Boolean },
},
setup(props) {
const botStore = useBotStore();
const combinedPairList = computed(() => {
});
const botStore = useBotStore();
const combinedPairList = computed(() => {
const comb: CombinedPairList[] = [];
props.pairlist.forEach((pair) => {
@ -117,8 +113,8 @@ export default defineComponent({
});
}
return comb;
});
const tableFields = computed(() => {
});
const tableFields = computed(() => {
return [
{ key: 'pair', label: 'Pair' },
{
@ -132,13 +128,6 @@ export default defineComponent({
formatter: (value) => formatPercent(value, 3),
},
];
});
return {
combinedPairList,
tableFields,
botStore,
};
},
});
</script>