composition: botstatus

This commit is contained in:
Matthias 2022-04-15 19:57:17 +02:00
parent de0838b97b
commit 166eef6a93

View File

@ -39,25 +39,30 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import { BotState, ProfitInterface } from '@/types';
import { BotStoreGetters } from '@/store/modules/ftbot'; import { BotStoreGetters } from '@/store/modules/ftbot';
import { formatPercent } from '@/shared/formatters'; import { formatPercent } from '@/shared/formatters';
import DateTimeTZ from '@/components/general/DateTimeTZ.vue'; import DateTimeTZ from '@/components/general/DateTimeTZ.vue';
import StoreModules from '@/store/storeSubModules'; import StoreModules from '@/store/storeSubModules';
const ftbot = namespace(StoreModules.ftbot); import { defineComponent } from '@vue/composition-api';
import { useNamespacedGetters } from 'vuex-composition-helpers';
@Component({ components: { DateTimeTZ } }) export default defineComponent({
export default class BotStatus extends Vue { name: 'BotStatus',
@ftbot.Getter [BotStoreGetters.version]: string; components: { DateTimeTZ },
setup() {
@ftbot.Getter [BotStoreGetters.profit]: ProfitInterface | {}; const { version, profit, botState } = useNamespacedGetters(StoreModules.ftbot, [
BotStoreGetters.version,
@ftbot.Getter [BotStoreGetters.botState]?: BotState; BotStoreGetters.profit,
BotStoreGetters.botState,
formatPercent = formatPercent; ]);
} return {
version,
profit,
botState,
formatPercent,
};
},
});
</script> </script>