Skip to content

Commit 7255f89

Browse files
committed
added btn color prop
1 parent 9291241 commit 7255f89

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

dist/index.js

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ssr.index.js

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Button.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ export default {
6868
: typeof value === 'string'
6969
}
7070
},
71+
buttonColor: {
72+
type: [String, Object],
73+
validator (value) {
74+
return typeof value === 'object'
75+
? (value.checked || value.unchecked)
76+
: typeof value === 'string'
77+
}
78+
},
7179
cssColors: {
7280
type: Boolean,
7381
default: false
@@ -125,7 +133,8 @@ export default {
125133
transition: `transform ${this.speed}ms`,
126134
transform: this.toggled
127135
? `translate3d(${this.distance}, 3px, 0px)`
128-
: null
136+
: null,
137+
backgroundColor: this.buttonColor ? this.buttonColor : undefined
129138
}
130139
},
131140

0 commit comments

Comments
 (0)