fixed weight slider

This commit is contained in:
Niko Feith 2023-04-06 15:31:42 +02:00
parent 7bbbf54044
commit 75e5b034df

View File

@ -1,10 +1,10 @@
<template> <template>
<v-row no-gutters justify="center" class="weight-tuner"> <v-row no-gutters justify="center" class="weight-tuner">
<!-- eslint-disable-next-line --> <!-- eslint-disable-next-line -->
<v-col v-for="(weight, idx) in weights"> <v-col v-for="(_ , idx) in weights" :key="idx">
<div class="weight-container"> <div class="weight-container">
<vue-slider <vue-slider
:value="weight" v-model="weights[idx]"
@change="updateWeight(idx, $event)" @change="updateWeight(idx, $event)"
direction="btt" direction="btt"
:height="100" :height="100"
@ -26,7 +26,10 @@ import { computed } from "vue";
const store = usePStore(); const store = usePStore();
const weights = computed(() => store.weights); const weights = computed({
get: () => store.weights,
set: (value) => store.setWeights(value),
});
const updateWeight = (index, newValue) => { const updateWeight = (index, newValue) => {
const newWeights = weights.value.slice(); const newWeights = weights.value.slice();