4daebf8c-dc42-4579-b104-0ed8afe17301 — Commit 8ab21f9f

AuthorMikkel Thygesen<Mikkelet@gmail.com>
Date2026-05-20 11:32:56 +0200
Fixed query param not adding

Changed files

src/components/QueryParamEditor.vue | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Diff

diff --git a/src/components/QueryParamEditor.vue b/src/components/QueryParamEditor.vue
index cd89948..e7a9d45 100644
--- a/src/components/QueryParamEditor.vue
+++ b/src/components/QueryParamEditor.vue
@@ -30,17 +30,22 @@ function entriesToRecord(entries: QueryParamEntry[]): Record<string, QueryParamT
}
const params = ref<QueryParamEntry[]>(recordToEntries(props.modelValue))
+let suppressWatch = false
watch(
() => props.modelValue,
(val) => {
+ if (suppressWatch) {
+ suppressWatch = false
+ return
+ }
params.value = recordToEntries(val)
}
)
function addParam() {
params.value.push({ key: '', type: 'string' })
- emitUpdate()
+ // Don't emit — empty key would be filtered out and the watch would wipe the row.
}
function removeParam(index: number) {
@@ -49,6 +54,7 @@ function removeParam(index: number) {
}
function emitUpdate() {
+ suppressWatch = true
emit('update:modelValue', entriesToRecord(params.value))
}
</script>