botControls to typescript

This commit is contained in:
Matthias 2020-08-09 15:23:04 +02:00
parent 8fcbc62af7
commit 54463d7452
2 changed files with 25 additions and 22 deletions

View File

@ -17,27 +17,30 @@
</div>
</template>
<script>
import { mapActions, mapState } from 'vuex';
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import { BotState } from '@/store/types';
import ForceBuyForm from './ForceBuyForm.vue';
export default {
name: 'BotControls',
components: { ForceBuyForm },
computed: {
...mapState('ftbot', ['botState']),
},
data() {
return {
forcebuyShow: false,
};
},
methods: {
...mapActions('ftbot', ['startBot', 'stopBot', 'stopBuy', 'reloadConfig']),
const ftbot = namespace('ftbot');
@Component({ components: { ForceBuyForm } })
export default class BotControls extends Vue {
forcebuyShow = false;
@ftbot.State botState: BotState;
@ftbot.Action startBot;
@ftbot.Action stopBot;
@ftbot.Action stopBuy;
@ftbot.Action reloadConfig;
initiateForcebuy() {
console.log('Forcebuy started');
this.$bvModal.show('forcebuy-modal');
},
},
};
}
}
</script>

View File

@ -36,7 +36,7 @@
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
import BotState from '@/store/types';
import { BotState } from '@/store/types';
const ftbot = namespace('ftbot');