Convert performance to typescript

This commit is contained in:
Matthias 2020-08-09 14:55:29 +02:00
parent 61fe53660b
commit 139d9866cc
3 changed files with 23 additions and 18 deletions

View File

@ -7,22 +7,21 @@
</div>
</template>
<script>
import { mapState } from 'vuex';
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import { PerformanceEntry } from '@/store/types';
export default {
name: 'Performance',
computed: {
...mapState('ftbot', ['performanceStats']),
},
data() {
return {
tableFields: [
{ key: 'pair', label: 'Pair' },
{ key: 'profit', label: 'Profit' },
{ key: 'count', label: 'Count' },
],
};
},
};
const ftbot = namespace('ftbot');
@Component({})
export default class Performance extends Vue {
@ftbot.State performanceStats!: Array<PerformanceEntry>;
private tableFields = [
{ key: 'pair', label: 'Pair' },
{ key: 'profit', label: 'Profit' },
{ key: 'count', label: 'Count' },
];
}
</script>

View File

@ -43,7 +43,7 @@
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import LoginModal from '@/views/LoginModal.vue';
import { State, Mutation, Action, namespace } from 'vuex-class';
import { State, Mutation, namespace } from 'vuex-class';
import userService from '@/shared/userService';
import BootswatchThemeSelect from '@/components/BootswatchThemeSelect.vue';

View File

@ -12,6 +12,12 @@ export interface DailyInterface {
timescale: number;
}
export interface PerformanceEntry {
count: number;
pair: string;
profit: number;
}
export interface BotState {
bid_strategy: object;
ask_strategy: object;