From 9ead20c840f72f0a3714106054ddfbcfa0c84187 Mon Sep 17 00:00:00 2001 From: Andrew Haupt Date: Fri, 10 Aug 2018 15:49:59 -0700 Subject: [PATCH 1/3] Add `name` prop, which can be attached to input --- src/Button.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Button.vue b/src/Button.vue index 691cd16..df59552 100644 --- a/src/Button.vue +++ b/src/Button.vue @@ -4,6 +4,7 @@ :aria-checked="ariaChecked">
@@ -53,6 +54,9 @@ export default { type: Boolean, default: false }, + name: { + type: String + }, sync: { type: Boolean, default: false From bf7351eda0827275454ae7b4e641d0c21932eaaf Mon Sep 17 00:00:00 2001 From: Andrew Haupt Date: Fri, 10 Aug 2018 15:50:11 -0700 Subject: [PATCH 2/3] add name prop example to README and demo --- README.md | 11 ++++++----- demo/src/App.vue | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d900d5e..ad02299 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ screen shot 2018-03-01 at 10 33 39 - + ### Vue.js 2 toggle / switch button - simple, pretty, customizable. ![Imgur](http://i.imgur.com/a2Hf7pm.png) @@ -33,12 +33,12 @@ Use: - - ``` @@ -61,6 +61,7 @@ import ToggleButton from 'vue-js-toggle-button/src/Button' | switchColor | [String, Object] | `#BFCBD9` | If `String` - color or background property of the switch when checked
If `Object` - colors or background property for the switch when checked/uncheked
Example: `{checked: '#25EF02', unchecked: 'linear-gradient(red, yellow)'}` | | width | Number | 50 | Width of the button, default is 50 | | height | Number | 22 | Height of the button, default is 22 | +| name | String | false | Name to attach to the generated input field | `labels` object accepts HTML text (for example, you can use FontAwesome for checked/unchecked states). diff --git a/demo/src/App.vue b/demo/src/App.vue index 11739fb..3430050 100644 --- a/demo/src/App.vue +++ b/demo/src/App.vue @@ -12,6 +12,7 @@ @@ -34,7 +35,7 @@ :color="{unchecked: '#FF6699'}" :labels="{unchecked: 'Disabled button'}" :disabled="true"/> - + Date: Sat, 11 Aug 2018 06:35:26 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad02299..4e55126 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ import ToggleButton from 'vue-js-toggle-button/src/Button' | switchColor | [String, Object] | `#BFCBD9` | If `String` - color or background property of the switch when checked
If `Object` - colors or background property for the switch when checked/uncheked
Example: `{checked: '#25EF02', unchecked: 'linear-gradient(red, yellow)'}` | | width | Number | 50 | Width of the button, default is 50 | | height | Number | 22 | Height of the button, default is 22 | -| name | String | false | Name to attach to the generated input field | +| name | String | undefined | Name to attach to the generated input field | `labels` object accepts HTML text (for example, you can use FontAwesome for checked/unchecked states).