Fix a few type problems

This commit is contained in:
Matthias 2022-11-30 19:48:46 +01:00
parent 617bdfbe2b
commit 71fd236674
6 changed files with 10 additions and 11 deletions

View File

@ -49,7 +49,7 @@
<b-popover
title="Add to blacklist"
target="blacklist-add-btn"
triggers="click blur"
triggers="click"
:show.sync="blackListShow"
>
<form ref="form" @submit.prevent>

View File

@ -176,8 +176,8 @@ export default defineComponent({
const resetForm = () => {
console.log('resetForm');
selectedPair.value = props.pair;
price.value = null;
stakeAmount.value = null;
price.value = undefined;
stakeAmount.value = undefined;
if (botStore.activeBot.botApiVersion > 1.1) {
ordertype.value =
botStore.activeBot.botState?.order_types?.forcebuy ||

View File

@ -27,7 +27,7 @@ import { defineComponent, computed, onMounted } from 'vue';
export default defineComponent({
name: 'StrategySelect',
props: {
value: { type: String, required: true },
modelValue: { type: String, required: true },
showDetails: { default: false, required: false, type: Boolean },
},
emits: ['input'],
@ -37,7 +37,7 @@ export default defineComponent({
const strategyCode = computed((): string => botStore.activeBot.strategy?.code);
const locStrategy = computed({
get() {
return props.value;
return props.modelValue;
},
set(strategy: string) {
botStore.activeBot.getStrategy(strategy);

View File

@ -45,7 +45,7 @@ const now = new Date();
export default defineComponent({
name: 'TimeRangeSelect',
props: {
value: { required: true, type: String },
modelValue: { required: true, type: String },
},
setup(props, { emit }) {
const dateFrom = ref<string>('');
@ -63,7 +63,7 @@ export default defineComponent({
};
const updateInput = () => {
const tr = props.value.split('-');
const tr = props.modelValue.split('-');
if (tr[0]) {
dateFrom.value = timestampToDateString(dateFromString(tr[0], 'yyyyMMdd'));
}
@ -79,7 +79,7 @@ export default defineComponent({
);
onMounted(() => {
if (!props.value) {
if (!props.modelValue) {
dateFrom.value = timestampToDateString(new Date(now.getFullYear(), now.getMonth() - 1, 1));
} else {
updateInput();

View File

@ -4,7 +4,7 @@
:class="isProfitable ? 'profit-pill-profit' : ''"
:title="profitDesc"
>
<profit-symbol :profit="profitRatio || profitAbs" />
<profit-symbol :profit="(profitRatio || profitAbs) ?? 0" />
<div class="d-flex justify-content-center align-items-center flex-grow-1">
{{ profitRatio !== undefined ? formatPercent(profitRatio, 2) : '' }}

View File

@ -75,8 +75,7 @@ const routes: Array<RouteRecordRaw> = [
];
const router = createRouter({
history: createWebHistory(),
base: import.meta.env.BASE_URL,
history: createWebHistory(import.meta.env.BASE_URL),
routes,
});