mirror of
https://github.com/czhu12/canine.git
synced 2025-12-31 00:10:14 -06:00
16 lines
405 B
JavaScript
16 lines
405 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
export default class extends Controller {
|
|
static targets = ["input", "icon"]
|
|
|
|
toggle() {
|
|
if (this.inputTarget.type === "password") {
|
|
this.inputTarget.type = "text"
|
|
this.iconTarget.setAttribute("icon", "mdi:eye-off")
|
|
} else {
|
|
this.inputTarget.type = "password"
|
|
this.iconTarget.setAttribute("icon", "mdi:eye")
|
|
}
|
|
}
|
|
}
|