diff --git a/components/button/README.md b/components/button/README.md index 4b691629..f82e380e 100644 --- a/components/button/README.md +++ b/components/button/README.md @@ -17,40 +17,37 @@ var vm = new Vue({ ### events -| event | args | Description | -|-------|------|-------------| -|`@click`||emitted on click | - +| event | args | Description | +| -------- | ---- | ---------------- | +| `@click` | | emitted on click | ### props -| prop | Type | Default | Description | -|-------|------|---------|-------------| -|`disabled`|String|| disable the button | -|`accent`|Boolean|| secondary color theme | -|`raised`| Boolean|| a contained button that is elevated upon the surface | -|`unelevated`| Boolean|| a contained button that is flush with the surface | -|`stroked`| Boolean|| a contained button that is flush with the surface and has a visible border(*)| -|`dense`| String|| compresses the button text to make it slightly smaller | -|`compact`| Boolean|| reduces the amount of horizontal padding in the button | -|`event`|String| optional | optional event to emit on click | -|`event-target`|Object| vm.$root | optional event target, defaults to root bus | -|`event-args`|Array| [] | optional event args | -|`href`|String|| link's href, renders anchor (see notes below) | -|`to`|String, Object| undefined | router-link property _(*)_ | -|`replace`|Boolean| false | router-link property _(*)_ | -|`append`|Boolean| false | router-link property _(*)_ | -|`exact`|Boolean| false | router-link property _(*)_ | -|`active-class`|String| router-link-active | router-link property _(*)_ | -|`exact-active-class`|String| router-link-exact-active | router-link property _(*)_ | - -> _(*)_ Requires [vue-router](https://router.vuejs.org) +| prop | Type | Default | Description | +| -------------------- | -------------- | ------------------------ | ------------------------------------------------------------------------------ | +| `disabled` | String | | disable the button | +| `accent` | Boolean | | secondary color theme | +| `raised` | Boolean | | a contained button that is elevated upon the surface | +| `unelevated` | Boolean | | a contained button that is flush with the surface | +| `stroked` | Boolean | | a contained button that is flush with the surface and has a visible border(\*) | +| `dense` | String | | compresses the button text to make it slightly smaller | +| `event` | String | optional | optional event to emit on click | +| `event-target` | Object | vm.$root | optional event target, defaults to root bus | +| `event-args` | Array | [] | optional event args | +| `href` | String | | link's href, renders anchor (see notes below) | +| `to` | String, Object | undefined | router-link property _(\*)_ | +| `replace` | Boolean | false | router-link property _(\*)_ | +| `append` | Boolean | false | router-link property _(\*)_ | +| `exact` | Boolean | false | router-link property _(\*)_ | +| `active-class` | String | router-link-active | router-link property _(\*)_ | +| `exact-active-class` | String | router-link-exact-active | router-link property _(\*)_ | + +> _(\*)_ Requires [vue-router](https://router.vuejs.org) ### text buttons ```html Baseline -Compact Dense ``` @@ -58,7 +55,6 @@ var vm = new Vue({ ```html Baseline -Compact Dense ``` @@ -66,7 +62,6 @@ var vm = new Vue({ ```html Baseline -Compact Dense ``` @@ -97,8 +92,8 @@ If the `to` property is defined, the item behaves as a #### Accessibility Warning: -> Buttons are expected to be triggered using the Space or Enter key, -> while links are expected to be triggered using the Enter key. +> Buttons are expected to be triggered using the Space or Enter key, +> while links are expected to be triggered using the Enter key. > Additionally, button and links have different behaviors on right click. > see this [MDN note](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_button_role#Keyboard_and_focus) @@ -116,9 +111,10 @@ You might want to keep button behavior and do the navigation programatically: ``` ```javascript - // register event from some component context - this.$root.$on('my-event', () => doSomething()) +// register event from some component context +this.$root.$on('my-event', () => doSomething()); ``` ### Reference -- + +* diff --git a/components/button/demo.vue b/components/button/demo.vue index bcf476e1..74de5a3c 100644 --- a/components/button/demo.vue +++ b/components/button/demo.vue @@ -2,13 +2,13 @@
- Button - Button - Button
@@ -24,7 +24,6 @@
-
@@ -34,35 +33,40 @@ \ No newline at end of file + diff --git a/components/button/mdc-button.vue b/components/button/mdc-button.vue index d4b501fa..b863ff14 100644 --- a/components/button/mdc-button.vue +++ b/components/button/mdc-button.vue @@ -1,5 +1,5 @@