BulmaSecret: click_state -> state
This commit is contained in:
parent
106797a70a
commit
610a7838c0
1 changed files with 7 additions and 6 deletions
|
@ -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";
|
||||||
|
|
Loading…
Reference in a new issue