refactor: change defaults macro param usecase
This commit is contained in:
@@ -40,20 +40,14 @@
|
|||||||
<v-text-field
|
<v-text-field
|
||||||
:label="name"
|
:label="name"
|
||||||
v-model="params[name].value"
|
v-model="params[name].value"
|
||||||
|
:placeholder="params[name].default"
|
||||||
|
:persistent-placeholder="true"
|
||||||
hide-details
|
hide-details
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
>
|
clearable
|
||||||
<template v-slot:append>
|
clear-icon="mdi-refresh"
|
||||||
<v-btn
|
></v-text-field>
|
||||||
v-if="params[name].value !== params[name].default"
|
|
||||||
@click="params[name].value = params[name].default"
|
|
||||||
icon
|
|
||||||
small>
|
|
||||||
<v-icon>mdi-refresh</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
</v-text-field>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="my-2">
|
<v-row class="my-2">
|
||||||
@@ -78,8 +72,8 @@ import {GuiStateMacrogroupMacros} from '@/store/gui/types'
|
|||||||
|
|
||||||
interface param {
|
interface param {
|
||||||
type: 'int' | 'double' | 'string' | null,
|
type: 'int' | 'double' | 'string' | null,
|
||||||
default: string | null
|
default: string | number | null
|
||||||
value: string | null
|
value: string | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
interface params {
|
interface params {
|
||||||
@@ -114,7 +108,7 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
|||||||
this.params[name] = {
|
this.params[name] = {
|
||||||
type: this.klipperMacro.params[name].type,
|
type: this.klipperMacro.params[name].type,
|
||||||
default: this.klipperMacro.params[name].default,
|
default: this.klipperMacro.params[name].default,
|
||||||
value: this.klipperMacro.params[name].default
|
value: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user