feat: partial support for patches
This commit is contained in:
34
src/components/PatchEntry.vue
Normal file
34
src/components/PatchEntry.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import InputNumber from 'primevue/inputnumber';
|
||||
import ToggleSwitch from 'primevue/toggleswitch';
|
||||
import OptionRow from './OptionRow.vue';
|
||||
import { usePrfStore } from '../stores';
|
||||
|
||||
const prf = usePrfStore();
|
||||
|
||||
const toggleUnary = (key: string, val: boolean) => {
|
||||
if (val) {
|
||||
prf.current!.data.patches[key] = 'Enabled';
|
||||
} else {
|
||||
delete prf.current!.data.patches[key];
|
||||
}
|
||||
};
|
||||
|
||||
defineProps({
|
||||
id: String,
|
||||
name: String,
|
||||
tooltip: String,
|
||||
type: String,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<OptionRow :title="name" :tooltip="tooltip" :greytext="id">
|
||||
<ToggleSwitch
|
||||
v-if="type === undefined"
|
||||
:model-value="prf.current!.data.patches[id!] !== undefined"
|
||||
@update:model-value="(v: boolean) => toggleUnary(id!, v)"
|
||||
/>
|
||||
<InputNumber v-else class="number-input" />
|
||||
</OptionRow>
|
||||
</template>
|
Reference in New Issue
Block a user