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

View File

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