mirror of
https://github.com/tmaier/asn-qr-code-label-generator.git
synced 2026-03-14 08:33:37 +00:00
Update URL immediately when any form field changes
- Add @input handlers to text/number inputs (startNumber, prefix, leadingZeros) - Add @change handler to checkbox (borderToggle) - Remove updateUrl() call from generateLabels() since it's now handled by events The URL now stays in sync with the form state at all times, not just when clicking "Regenerate Labels".
This commit is contained in:
parent
71f735ca68
commit
4a37cbc0c6
1 changed files with 4 additions and 1 deletions
|
|
@ -89,6 +89,7 @@
|
|||
type="number"
|
||||
id="startNumber"
|
||||
x-model="startNumber"
|
||||
@input="updateUrl()"
|
||||
required
|
||||
min="1"
|
||||
step="1"
|
||||
|
|
@ -120,6 +121,7 @@
|
|||
type="text"
|
||||
id="prefix"
|
||||
x-model="prefix"
|
||||
@input="updateUrl()"
|
||||
required
|
||||
value="ASN"
|
||||
class="block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500"
|
||||
|
|
@ -147,6 +149,7 @@
|
|||
type="number"
|
||||
id="leadingZeros"
|
||||
x-model="leadingZeros"
|
||||
@input="updateUrl()"
|
||||
required
|
||||
value="5"
|
||||
min="0"
|
||||
|
|
@ -160,6 +163,7 @@
|
|||
type="checkbox"
|
||||
id="borderToggle"
|
||||
x-model="borderToggle"
|
||||
@change="updateUrl()"
|
||||
class="focus:ring-3 h-4 w-4 rounded border border-gray-300 bg-gray-50 focus:ring-blue-300"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -306,7 +310,6 @@
|
|||
|
||||
this.labels.push({ qrCodeUrl, text });
|
||||
}
|
||||
this.updateUrl();
|
||||
},
|
||||
printLabels() {
|
||||
window.print();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue