mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-13 03:33:50 +00:00
Improve strategylist component
This commit is contained in:
parent
b0a66cddc3
commit
28a1565c24
|
@ -1,8 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<b-form-group label="Strategy" label-for="strategyName" invalid-feedback="Strategy is required">
|
<div>
|
||||||
<b-form-select v-model="strategy" :options="strategyList" @change="strategyChanged">
|
<b-form-group label="Strategy" label-for="strategyName" invalid-feedback="Strategy is required">
|
||||||
</b-form-select>
|
<b-form-select v-model="locStrategy" :options="strategyList" @change="strategyChanged">
|
||||||
</b-form-group>
|
</b-form-select>
|
||||||
|
</b-form-group>
|
||||||
|
<textarea v-if="showDetails && strategy" v-model="strategyCode" class="w-100 h-100"></textarea>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -15,6 +18,8 @@ const ftbot = namespace('ftbot');
|
||||||
export default class StrategyList extends Vue {
|
export default class StrategyList extends Vue {
|
||||||
@Prop() value!: string;
|
@Prop() value!: string;
|
||||||
|
|
||||||
|
@Prop({ default: false, required: false }) showDetails!: boolean;
|
||||||
|
|
||||||
@ftbot.Action getStrategyList;
|
@ftbot.Action getStrategyList;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
@ -22,17 +27,23 @@ export default class StrategyList extends Vue {
|
||||||
|
|
||||||
@ftbot.State strategyList;
|
@ftbot.State strategyList;
|
||||||
|
|
||||||
|
@ftbot.State strategy;
|
||||||
|
|
||||||
@Emit('input')
|
@Emit('input')
|
||||||
emitStrategy(strategy: string) {
|
emitStrategy(strategy: string) {
|
||||||
this.getStrategy(strategy);
|
this.getStrategy(strategy);
|
||||||
return strategy;
|
return strategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
get strategy() {
|
get strategyCode(): string {
|
||||||
|
return this.strategy?.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
get locStrategy() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
set strategy(val) {
|
set locStrategy(val) {
|
||||||
this.emitStrategy(val);
|
this.emitStrategy(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user