1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: min and max option for random floats and numbers

This commit is contained in:
2021-02-16 19:13:20 +01:00
parent 9d5ebefdce
commit 6c62052b47
6 changed files with 46 additions and 18 deletions

View File

@ -74,6 +74,17 @@
:type="inputProps().type"
:disabled="!isChecked"
>
<template v-if="methodData && 'params' in methodData" class="columns">
<input
v-for="(option, key) in methodData.params"
:key="key"
v-model="methodParams[option]"
class="form-input column"
:type="inputProps().type"
:disabled="!isChecked"
:placeholder="option"
>
</template>
<slot />
</fieldset>
</template>
@ -107,7 +118,8 @@ export default {
selectedGroup: 'manual',
selectedMethod: '',
selectedValue: '',
debounceTimeout: null
debounceTimeout: null,
methodParams: {}
};
},
computed: {
@ -127,6 +139,9 @@ export default {
},
fakerMethods () {
return FakerMethods.getMethods({ type: this.localType, group: this.selectedGroup });
},
methodData () {
return this.fakerMethods.find(method => method.name === this.selectedMethod);
}
},
watch: {
@ -197,6 +212,7 @@ export default {
this.$emit('update:value', {
group: this.selectedGroup,
method: this.selectedMethod,
params: this.methodParams,
value: this.selectedValue,
length: this.fieldLength
});