frequi_origin/src/components/ftbot/StrategyList.vue

50 lines
1.0 KiB
Vue
Raw Normal View History

2020-07-31 05:17:50 +00:00
<template>
<b-form-group label="Strategy" label-for="strategyName" invalid-feedback="Strategy is required">
2020-08-31 17:16:25 +00:00
<b-form-select v-model="strategy" :options="strategyList" @change="strategyChanged">
2020-07-31 05:17:50 +00:00
</b-form-select>
</b-form-group>
</template>
<script lang="ts">
import { Component, Vue, Prop, Emit } from 'vue-property-decorator';
import { namespace } from 'vuex-class';
const ftbot = namespace('ftbot');
@Component({})
export default class StrategyList extends Vue {
@Prop() value!: string;
@ftbot.Action getStrategyList;
2020-09-17 06:01:23 +00:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@ftbot.Action getStrategy!: (strategy: string) => void;
2020-07-31 05:17:50 +00:00
@ftbot.State strategyList;
@Emit('input')
emitStrategy(strategy: string) {
2020-09-17 06:01:23 +00:00
this.getStrategy(strategy);
2020-07-31 05:17:50 +00:00
return strategy;
}
get strategy() {
return this.value;
}
set strategy(val) {
this.emitStrategy(val);
}
strategyChanged(newVal) {
this.value = newVal;
}
mounted() {
this.getStrategyList();
}
}
</script>
<style></style>