mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-25 12:35:15 +00:00
use plotStore instead of vmodel for plotConfigurator
This commit is contained in:
parent
e99deff46f
commit
c5da60c090
|
@ -9,7 +9,7 @@
|
|||
hide-backdrop
|
||||
button-size="sm"
|
||||
>
|
||||
<PlotConfigurator v-model="plotStore.plotConfig" :columns="datasetColumns" />
|
||||
<PlotConfigurator :columns="datasetColumns" />
|
||||
</b-modal>
|
||||
|
||||
<div class="row mr-0">
|
||||
|
@ -85,11 +85,7 @@
|
|||
</div>
|
||||
<transition name="fade" mode="in-out">
|
||||
<div v-if="!plotConfigModal" v-show="showPlotConfig" class="w-25 config-sidebar">
|
||||
<PlotConfigurator
|
||||
v-model="plotStore.plotConfig"
|
||||
:columns="datasetColumns"
|
||||
:as-modal="false"
|
||||
/>
|
||||
<PlotConfigurator :columns="datasetColumns" :as-modal="false" />
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
|
|
|
@ -133,13 +133,11 @@ export default defineComponent({
|
|||
name: 'PlotConfigurator',
|
||||
components: { PlotIndicator },
|
||||
props: {
|
||||
value: { type: Object as () => PlotConfig, required: true },
|
||||
columns: { required: true, type: Array as () => string[] },
|
||||
asModal: { required: false, default: true, type: Boolean },
|
||||
},
|
||||
emits: ['input'],
|
||||
setup(props, { emit }) {
|
||||
const botStore = useBotStore();
|
||||
const plotStore = usePlotConfigStore();
|
||||
|
||||
const plotConfig = ref<PlotConfig>(EMPTY_PLOTCONFIG);
|
||||
|
@ -290,6 +288,7 @@ export default defineComponent({
|
|||
};
|
||||
const loadPlotConfigFromStrategy = async () => {
|
||||
try {
|
||||
const botStore = useBotStore();
|
||||
await botStore.activeBot.getStrategyPlotConfig();
|
||||
if (botStore.activeBot.strategyPlotConfig) {
|
||||
plotConfig.value = botStore.activeBot.strategyPlotConfig;
|
||||
|
@ -305,19 +304,14 @@ export default defineComponent({
|
|||
plotStore.saveCustomPlotConfig({ [plotConfigNameLoc.value]: plotConfig.value });
|
||||
};
|
||||
|
||||
watch(props.value, () => {
|
||||
console.log('config value');
|
||||
plotConfig.value = props.value;
|
||||
plotConfigNameLoc.value = plotStore.plotConfigName;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
console.log('Config Mounted', props.value);
|
||||
plotConfig.value = props.value;
|
||||
// console.log('Config Mounted', props.value);
|
||||
plotConfig.value = plotStore.plotConfig;
|
||||
plotConfigNameLoc.value = plotStore.plotConfigName;
|
||||
});
|
||||
|
||||
return {
|
||||
plotStore,
|
||||
removeIndicator,
|
||||
addSubplot,
|
||||
delSubplot,
|
||||
|
|
Loading…
Reference in New Issue
Block a user