BulmaSecret: click_state -> state

This commit is contained in:
Jörn-Michael Miehe 2023-09-14 04:00:04 +00:00
parent 106797a70a
commit 610a7838c0

View file

@ -19,22 +19,23 @@ enum ClickState {
emits: ["load"], emits: ["load"],
}) })
export default class extends Vue { export default class extends Vue {
public click_state = ClickState.Green; public state = ClickState.Green;
public on_click(): void { public on_click(): void {
this.click_state = (this.click_state + 1) % 3; this.state++;
this.state %= 3;
if (this.click_state === ClickState.Red) { if (this.state === ClickState.Red) {
this.$emit("load"); this.$emit("load");
} }
} }
public get show(): boolean { public get show(): boolean {
return this.click_state === ClickState.Red; return this.state === ClickState.Red;
} }
public get button_class(): string { public get button_class(): string {
switch (this.click_state) { switch (this.state) {
case ClickState.Red: case ClickState.Red:
return "danger"; return "danger";
case ClickState.Yellow: case ClickState.Yellow:
@ -45,7 +46,7 @@ export default class extends Vue {
} }
public get button_icon(): string { public get button_icon(): string {
if (this.click_state === ClickState.Red) { if (this.state === ClickState.Red) {
return "eye-slash"; return "eye-slash";
} else { } else {
return "eye"; return "eye";