Migrated SMD reel calculator tool logic to stimulus.

This commit is contained in:
Jan Böhmer 2022-08-03 20:56:00 +02:00
parent cfd9713e5d
commit 1c7c3bf2c5
3 changed files with 123 additions and 91 deletions

View file

@ -0,0 +1,16 @@
import {Controller} from "@hotwired/stimulus";
export default class extends Controller {
static targets = ["input"];
connect() {
if(!this.inputTarget) {
throw new Error("Target input not found");
}
}
load(event) {
//Use the data-value attribute to load the value of our target input
this.inputTarget.value = event.target.dataset.value;
}
}