diff --git a/docs/src/pages/components/Switch.vue b/docs/src/pages/components/Switch.vue index 289775e..22bfe83 100644 --- a/docs/src/pages/components/Switch.vue +++ b/docs/src/pages/components/Switch.vue @@ -36,6 +36,16 @@ Light Blue Primary Color Disabled + + + Button (default) + +
+
+ Submit +
+
+
@@ -67,6 +77,28 @@ </div> + + + +<div> + <md-switch v-model="checked8" id="my-test8" name="my-test8" class="md-primary">Button (default)</md-switch> +</div> + +<form @click.stop.prevent="submit"> + <md-switch type="submit" v-model="checked9" id="my-test9" name="my-test9">Submit</md-switch> +</form> + + + +export default { + methods: { + submit(e) { + alert('This switch submits the form'); + } + } +}; + +
@@ -86,8 +118,17 @@ checked4: true, checked5: true, checked6: true, - checked7: true + checked7: true, + checked8: true, + checked9: true, + checked10: true }; + }, + + methods: { + submit() { + alert('This switch submits the form'); + } } }; diff --git a/src/components/mdSwitch/mdSwitch.vue b/src/components/mdSwitch/mdSwitch.vue index e2188a3..549ef50 100644 --- a/src/components/mdSwitch/mdSwitch.vue +++ b/src/components/mdSwitch/mdSwitch.vue @@ -3,7 +3,7 @@
- +
@@ -24,7 +24,11 @@ name: String, value: Boolean, id: String, - disabled: Boolean + disabled: Boolean, + type: { + type: String, + default: 'button' + } }, data() { return {