mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-23 03:25:15 +00:00
StrategySelect -> script setup
This commit is contained in:
parent
1cc8f910c2
commit
e2624cea54
|
@ -20,43 +20,33 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import { useBotStore } from '@/stores/ftbotwrapper';
|
import { useBotStore } from '@/stores/ftbotwrapper';
|
||||||
import { defineComponent, computed, onMounted } from 'vue';
|
import { computed, onMounted } from 'vue';
|
||||||
|
|
||||||
export default defineComponent({
|
const props = defineProps({
|
||||||
name: 'StrategySelect',
|
modelValue: { type: String, required: true },
|
||||||
props: {
|
showDetails: { default: false, required: false, type: Boolean },
|
||||||
modelValue: { type: String, required: true },
|
});
|
||||||
showDetails: { default: false, required: false, type: Boolean },
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
const botStore = useBotStore();
|
||||||
|
|
||||||
|
const strategyCode = computed((): string => botStore.activeBot.strategy?.code);
|
||||||
|
const locStrategy = computed({
|
||||||
|
get() {
|
||||||
|
return props.modelValue;
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue'],
|
set(strategy: string) {
|
||||||
setup(props, { emit }) {
|
botStore.activeBot.getStrategy(strategy);
|
||||||
const botStore = useBotStore();
|
emit('update:modelValue', strategy);
|
||||||
|
|
||||||
const strategyCode = computed((): string => botStore.activeBot.strategy?.code);
|
|
||||||
const locStrategy = computed({
|
|
||||||
get() {
|
|
||||||
return props.modelValue;
|
|
||||||
},
|
|
||||||
set(strategy: string) {
|
|
||||||
botStore.activeBot.getStrategy(strategy);
|
|
||||||
emit('update:modelValue', strategy);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (botStore.activeBot.strategyList.length === 0) {
|
|
||||||
botStore.activeBot.getStrategyList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
botStore,
|
|
||||||
strategyCode,
|
|
||||||
locStrategy,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (botStore.activeBot.strategyList.length === 0) {
|
||||||
|
botStore.activeBot.getStrategyList();
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user