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> </b-list-group>
</template> </template>
<script lang="ts"> <script setup lang="ts">
import { formatPercent, timestampms } from '@/shared/formatters'; import { formatPercent, timestampms } from '@/shared/formatters';
import { Lock, Trade } from '@/types'; import { Lock, Trade } from '@/types';
import TradeProfit from '@/components/ftbot/TradeProfit.vue'; import TradeProfit from '@/components/ftbot/TradeProfit.vue';
import ProfitPill from '@/components/general/ProfitPill.vue'; import ProfitPill from '@/components/general/ProfitPill.vue';
import { defineComponent, computed } from 'vue'; import { computed } from 'vue';
import { useBotStore } from '@/stores/ftbotwrapper'; import { useBotStore } from '@/stores/ftbotwrapper';
interface CombinedPairList { interface CombinedPairList {
@ -44,18 +44,14 @@ interface CombinedPairList {
tradeCount: number; tradeCount: number;
} }
export default defineComponent({ const props = defineProps({
name: 'PairSummary',
components: { TradeProfit, ProfitPill },
props: {
// TOOD: Should be string list // TOOD: Should be string list
pairlist: { required: true, type: Array as () => string[] }, pairlist: { required: true, type: Array as () => string[] },
currentLocks: { required: false, type: Array as () => Lock[], default: () => [] }, currentLocks: { required: false, type: Array as () => Lock[], default: () => [] },
trades: { required: true, type: Array as () => Trade[] }, trades: { required: true, type: Array as () => Trade[] },
sortMethod: { default: 'normal', type: String }, sortMethod: { default: 'normal', type: String },
backtestMode: { required: false, default: false, type: Boolean }, backtestMode: { required: false, default: false, type: Boolean },
}, });
setup(props) {
const botStore = useBotStore(); const botStore = useBotStore();
const combinedPairList = computed(() => { const combinedPairList = computed(() => {
const comb: CombinedPairList[] = []; const comb: CombinedPairList[] = [];
@ -133,13 +129,6 @@ export default defineComponent({
}, },
]; ];
}); });
return {
combinedPairList,
tableFields,
botStore,
};
},
});
</script> </script>
<style scoped> <style scoped>