From 7c4e747e58d98d8287e57e452a486292ec8c0780 Mon Sep 17 00:00:00 2001 From: freyamade Date: Fri, 21 Jan 2022 11:31:02 +0000 Subject: [PATCH] Gear dropdown filters set up to include current item if the item level of it is lower than the filters allow --- frontend/src/components/gear_dropdown.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/gear_dropdown.vue b/frontend/src/components/gear_dropdown.vue index d64e1da8..d5ae2f80 100644 --- a/frontend/src/components/gear_dropdown.vue +++ b/frontend/src/components/gear_dropdown.vue @@ -9,7 +9,7 @@
@@ -31,6 +31,12 @@ export default class GearDropdown extends Vue { @Prop() error!: string[] | undefined + @Prop() + maxIl!: number + + @Prop() + minIl!: number + @Prop() name!: string @@ -41,6 +47,10 @@ export default class GearDropdown extends Vue { return this.$refs.dropdown as HTMLSelectElement } + get gear(): Gear[] { + return this.choices.filter((item: Gear) => item.id === this.value || (item.item_level <= this.maxIl && item.item_level >= this.minIl)) + } + handleInput(): void { this.$emit('input', this.dropdown.value) }