Config UI: only reset form-data on manual template change (#12815)

This commit is contained in:
Michael Geers 2024-03-09 18:37:30 +01:00 • committed by GitHub
parent b5758f6a0f
commit b88c310142
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -41,6 +41,7 @@
<select
id="meterTemplate"
v-model="templateName"
@change="templateChanged"
:disabled="!isNew"
class="form-select w-100"
>
@ -62,7 +63,6 @@
{{ option.name }}
</option>
</select>
{{ templateName }}
</FormRow>
<p v-if="loadingTemplate">Loading ...</p>
<Modbus
@ -314,7 +314,6 @@ export default {
},
async loadTemplate() {
this.template = null;
this.reset();
this.loadingTemplate = true;
try {
const opts = {
@ -405,6 +404,9 @@ export default {
selectType(type) {
this.selectedType = type;
},
templateChanged() {
this.reset();
},
},
};
</script>

View file

@ -29,6 +29,7 @@
<select
id="vehicleTemplate"
v-model="templateName"
@change="templateChanged"
:disabled="!isNew"
class="form-select w-100"
>
@ -259,7 +260,6 @@ export default {
},
async loadTemplate() {
this.template = null;
this.reset();
try {
const opts = {
params: {
@ -341,6 +341,9 @@ export default {
modalInvisible() {
this.isModalVisible = false;
},
templateChanged() {
this.reset();
},
},
};
</script>