From 5dd17ccf555b91f2b4c634134e608dd8b1e544cc Mon Sep 17 00:00:00 2001 From: Guillaume Rouxel Date: Mon, 24 Oct 2016 22:36:00 +0200 Subject: [PATCH] add 'type' props to switch button --- docs/src/pages/components/Switch.vue | 43 +++++++++++++++++++++++++++- src/components/mdSwitch/mdSwitch.vue | 5 ++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/docs/src/pages/components/Switch.vue b/docs/src/pages/components/Switch.vue index 289775e..b8478e4 100644 --- a/docs/src/pages/components/Switch.vue +++ b/docs/src/pages/components/Switch.vue @@ -36,6 +36,16 @@ Light Blue Primary Color Disabled + + +
+ Submit (default) +
+ +
+ Button +
+
@@ -67,6 +77,28 @@ </div> + + + +<form @click.stop.prevent="submit"> + <md-switch v-model="checked8" id="my-test8" name="my-test8">Submit (default)</md-switch> +</form> + +<div> + <md-switch type="button" v-model="checked9" id="my-test9" name="my-test9" class="md-primary">Button</md-switch> +</div> + + + +export default { + methods: { + submit(e) { + alert('Default switch submits form'); + } + } +}; + +
@@ -86,8 +118,17 @@ checked4: true, checked5: true, checked6: true, - checked7: true + checked7: true, + checked8: true, + checked9: true, + checked10: true }; + }, + + methods: { + submit(e) { + alert('Default switch submits form'); + } } }; diff --git a/src/components/mdSwitch/mdSwitch.vue b/src/components/mdSwitch/mdSwitch.vue index e2188a3..d3c6a46 100644 --- a/src/components/mdSwitch/mdSwitch.vue +++ b/src/components/mdSwitch/mdSwitch.vue @@ -3,7 +3,7 @@
- +
@@ -24,7 +24,8 @@ name: String, value: Boolean, id: String, - disabled: Boolean + disabled: Boolean, + type: String }, data() { return {