Skip to content
This repository was archived by the owner on Apr 17, 2020. It is now read-only.

Commit 07cb4e6

Browse files
committed
Fixed button classes.
1 parent ba2397d commit 07cb4e6

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

Diff for: src/components/button/index.vue

+5-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<template>
22
<button
33
:type="type"
4-
:class="classList"
4+
:class="{
5+
button: true,
6+
'is-loading': loading,
7+
[`is-${option}`]: true
8+
}"
59
@click="onClick"
610
:disabled="disabled || loading"
711
:autofocus="autofocus"
@@ -34,26 +38,6 @@
3438
@Prop(Boolean)
3539
public readonly autofocus!: boolean;
3640
37-
private classList: object = {};
38-
39-
public created() {
40-
this.classList = {
41-
button: true,
42-
'is-loading': this.loading,
43-
'is-default': this.option === 'default',
44-
'is-primary': this.option === 'primary',
45-
'is-success': this.option === 'success',
46-
'is-info': this.option === 'info',
47-
'is-warning': this.option === 'warning',
48-
'is-danger': this.option === 'danger',
49-
'is-white': this.option === 'white',
50-
'is-light': this.option === 'light',
51-
'is-dark': this.option === 'dark',
52-
'is-black': this.option === 'black',
53-
'is-text': this.option === 'text',
54-
};
55-
}
56-
5741
public onClick(e) {
5842
this.$emit('click', e);
5943
}

0 commit comments

Comments
 (0)