frequi_origin/src/components/ftbot/TradeActions.vue

70 lines
1.7 KiB
Vue
Raw Normal View History

<template>
<div class="d-flex flex-column">
<b-button
v-if="botApiVersion <= 1.1"
class="btn-xs text-left"
size="sm"
2022-05-22 07:26:02 +00:00
title="Forceexit"
2021-12-26 15:04:19 +00:00
@click="$emit('forceSell', trade)"
>
2022-05-22 07:26:02 +00:00
<ForceSellIcon :size="16" title="Forceexit" class="mr-1" />Forceexit
</b-button>
<b-button
v-if="botApiVersion > 1.1"
class="btn-xs text-left"
size="sm"
2022-05-22 07:26:02 +00:00
title="Forceexit limit"
2021-12-26 15:04:19 +00:00
@click="$emit('forceSell', trade, 'limit')"
>
2022-05-22 07:26:02 +00:00
<ForceSellIcon :size="16" title="Forceexit limit" class="mr-1" />Forceexit limit
</b-button>
<b-button
v-if="botApiVersion > 1.1"
class="btn-xs text-left mt-1"
size="sm"
2022-05-22 07:26:02 +00:00
title="Forceexit market"
2021-12-26 15:04:19 +00:00
@click="$emit('forceSell', trade, 'market')"
>
2022-05-22 07:26:02 +00:00
<ForceSellIcon :size="16" title="Forceexit market" class="mr-1" />Forceexit market
</b-button>
<b-button
class="btn-xs text-left mt-1"
size="sm"
title="Delete trade"
@click="$emit('deleteTrade', trade)"
>
<DeleteIcon :size="16" title="Delete trade" class="mr-1" />
Delete
</b-button>
</div>
</template>
<script lang="ts">
import { Trade } from '@/types';
2022-07-07 18:44:19 +00:00
import { defineComponent } from 'vue';
import DeleteIcon from 'vue-material-design-icons/Delete.vue';
import ForceSellIcon from 'vue-material-design-icons/CloseBoxMultiple.vue';
export default defineComponent({
name: 'TradeActions',
components: { DeleteIcon, ForceSellIcon },
props: {
botApiVersion: {
type: Number,
default: 1.0,
},
trade: {
type: Object as () => Trade,
required: true,
},
},
emits: ['forceSell', 'deleteTrade'],
2021-12-26 15:04:19 +00:00
setup() {
return {};
},
});
</script>
<style scoped lang="scss"></style>