From 8cc88e267c3942a0441c123ae4ab9e554158102d Mon Sep 17 00:00:00 2001 From: stasson Date: Sun, 11 Feb 2018 10:41:23 +0100 Subject: [PATCH] feat(textfield): pass event-listeners and attributes to input element closes #242 --- components/textfield/README.md | 21 ++++++++------ components/textfield/mdc-textfield.vue | 39 +++++++++----------------- 2 files changed, 27 insertions(+), 33 deletions(-) diff --git a/components/textfield/README.md b/components/textfield/README.md index 77fb7482..5c35fc77 100644 --- a/components/textfield/README.md +++ b/components/textfield/README.md @@ -98,9 +98,7 @@ var vm = new Vue({ |-------|------|---------|-------------| |`v-model`| String || binds textfield value | |`disabled`| [Number, String] | | binds to disabled state | -|`type`|String|| input type attribute | -|`name`|String|| input name attribute | -|`readonly`|String|| input is readonly | +|`type`|String| text | input type attribute | |`label`| String | | hint text | |`dense`| Boolean | | compresses the textfield to make it slightly smaller | |`outline`| Boolean | | whether the textfield is outlined | @@ -120,11 +118,9 @@ var vm = new Vue({ |`trailing-icon`|[String, Array, Object ] | | trailing icon _*_| |`leading-icon`| [String, Array, Object ] | | leading icon _*_ | -(*) icon prop usage: -- use `String` for material icons -- use `Array` to specify icon classList -- use `{className: String, textContent: String}` for custom class and/or content -- use `trailing-icon` or `leading-icon` slots for custom icon markup (svg, ...). +> other attributes (`name`, `readonly`, ... ) are being passed down to the rendered input element. + +> (*) icon prop usage: use `String` for material icons, `Array` to specify icon classList, `{className: String, textContent: String}` for custom class and/or content, or use `trailing-icon` or `leading-icon` slots for custom icon markup (svg, ...). ### events @@ -133,6 +129,15 @@ var vm = new Vue({ |`@focus`| - |emitted on focus gained | |`@blur`| - |emitted on focus lost | |`@icon-action`| - |emitted on icon action | +|`@[listener]`| - |emitted on icon action | + +> Other bound listeners are being passsed down to the rendered input element + +```html + +``` + ### methods diff --git a/components/textfield/mdc-textfield.vue b/components/textfield/mdc-textfield.vue index 08be7a35..a755752c 100644 --- a/components/textfield/mdc-textfield.vue +++ b/components/textfield/mdc-textfield.vue @@ -11,28 +11,30 @@ + :rows="rows" :cols="cols" + > + :aria-controls="inputAriaControls" + />