From 5fbd497351e83c665d76be5b0866a6bdbd4620ed Mon Sep 17 00:00:00 2001 From: xon52 <30713944+xon52@users.noreply.github.com> Date: Thu, 9 Aug 2018 21:50:17 +1000 Subject: [PATCH 1/2] Adds a font size property to the switch. --- src/Button.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Button.vue b/src/Button.vue index 691cd16..d7770b2 100644 --- a/src/Button.vue +++ b/src/Button.vue @@ -32,6 +32,7 @@ const constants = { labelUnchecked: 'off', width: 50, height: 22, + fontSize: 16, margin: 3, switchColor: '#fff' } @@ -97,6 +98,10 @@ export default { width: { type: Number, default: constants.width + }, + fontSize: { + type: Number, + default: constants.fontSize } }, computed: { @@ -141,7 +146,8 @@ export default { labelStyle () { return { - lineHeight: px(this.height) + lineHeight: px(this.height), + fontSize: px(this.fontSize) } }, From afb9b4c73441c4316136164f2b8f91c7ea8ed9b1 Mon Sep 17 00:00:00 2001 From: Yev Vlasenko Date: Tue, 11 Dec 2018 10:44:05 +0200 Subject: [PATCH 2/2] Update Button.vue --- src/Button.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Button.vue b/src/Button.vue index d7770b2..2798dff 100644 --- a/src/Button.vue +++ b/src/Button.vue @@ -32,7 +32,6 @@ const constants = { labelUnchecked: 'off', width: 50, height: 22, - fontSize: 16, margin: 3, switchColor: '#fff' } @@ -100,8 +99,7 @@ export default { default: constants.width }, fontSize: { - type: Number, - default: constants.fontSize + type: Number } }, computed: { @@ -147,7 +145,7 @@ export default { labelStyle () { return { lineHeight: px(this.height), - fontSize: px(this.fontSize) + fontSize: this.fontSize ? px(this.fontSize) : null } },