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"],
|
||||
})
|
||||
export default class extends Vue {
|
||||
public click_state = ClickState.Green;
|
||||
public state = ClickState.Green;
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
public get show(): boolean {
|
||||
return this.click_state === ClickState.Red;
|
||||
return this.state === ClickState.Red;
|
||||
}
|
||||
|
||||
public get button_class(): string {
|
||||
switch (this.click_state) {
|
||||
switch (this.state) {
|
||||
case ClickState.Red:
|
||||
return "danger";
|
||||
case ClickState.Yellow:
|
||||
|
@ -45,7 +46,7 @@ export default class extends Vue {
|
|||
}
|
||||
|
||||
public get button_icon(): string {
|
||||
if (this.click_state === ClickState.Red) {
|
||||
if (this.state === ClickState.Red) {
|
||||
return "eye-slash";
|
||||
} else {
|
||||
return "eye";
|
||||
|
|
Loading…
Reference in a new issue