mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-22 19:15:15 +00:00
Add "expanding" chevron to highlight that there's more parameters
This commit is contained in:
parent
fa7ea5e797
commit
97e3290a31
|
@ -7,13 +7,27 @@
|
||||||
<div
|
<div
|
||||||
role="button"
|
role="button"
|
||||||
class="d-flex flex-grow-1 align-items-start flex-column"
|
class="d-flex flex-grow-1 align-items-start flex-column"
|
||||||
@click="visible = !visible"
|
@click="toggleVisible"
|
||||||
>
|
>
|
||||||
<span class="fw-bold fd-italic">{{ pairlist.name }}</span>
|
<span class="fw-bold fd-italic">{{ pairlist.name }}</span>
|
||||||
<span class="fw-lighter">{{ pairlist.description }}</span>
|
<span class="fw-lighter">{{ pairlist.description }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<b-button size="sm" @click="emit('remove', index)">
|
<i-mdi-chevron-down
|
||||||
|
v-if="!visible"
|
||||||
|
:class="hasParameters && !visible ? 'visible' : 'invisible'"
|
||||||
|
role="button"
|
||||||
|
class="fs-4"
|
||||||
|
@click="toggleVisible"
|
||||||
|
/>
|
||||||
|
<i-mdi-chevron-up
|
||||||
|
v-if="visible"
|
||||||
|
:class="hasParameters && visible ? 'visible' : 'invisible'"
|
||||||
|
role="button"
|
||||||
|
class="fs-4"
|
||||||
|
@click="toggleVisible"
|
||||||
|
/>
|
||||||
|
<b-button size="sm" class="ms-1" @click="emit('remove', index)">
|
||||||
<i-mdi-close />
|
<i-mdi-close />
|
||||||
</b-button>
|
</b-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,6 +51,7 @@
|
||||||
import { Pairlist } from '@/types';
|
import { Pairlist } from '@/types';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import PairlistConfigParameter from './PairlistConfigParameter.vue';
|
import PairlistConfigParameter from './PairlistConfigParameter.vue';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
index: number;
|
index: number;
|
||||||
|
@ -47,6 +62,14 @@ const emit = defineEmits(['remove']);
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
|
|
||||||
const pairlist = defineModel<Pairlist>({ required: true });
|
const pairlist = defineModel<Pairlist>({ required: true });
|
||||||
|
|
||||||
|
const hasParameters = computed(() => Object.keys(pairlist.value.params).length > 0);
|
||||||
|
|
||||||
|
function toggleVisible() {
|
||||||
|
if (hasParameters.value) {
|
||||||
|
visible.value = !visible.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user