mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-08 15:34:43 +00:00
Add blur and focus events to md-input
This commit is contained in:
parent
e845b16a96
commit
6d2337fa4f
2 changed files with 29 additions and 2 deletions
|
|
@ -114,6 +114,29 @@
|
|||
</md-table-row>
|
||||
</md-table-body>
|
||||
</md-table>
|
||||
|
||||
<md-table slot="events">
|
||||
<md-table-header>
|
||||
<md-table-row>
|
||||
<md-table-head>Name</md-table-head>
|
||||
<md-table-head>Value</md-table-head>
|
||||
<md-table-head>Description</md-table-head>
|
||||
</md-table-row>
|
||||
</md-table-header>
|
||||
|
||||
<md-table-body>
|
||||
<md-table-row>
|
||||
<md-table-cell>focus</md-table-cell>
|
||||
<md-table-cell>Emits the <code>Event</code> object</md-table-cell>
|
||||
<md-table-cell>Triggered when the user focuses the input</md-table-cell>
|
||||
</md-table-row>
|
||||
<md-table-row>
|
||||
<md-table-cell>blur</md-table-cell>
|
||||
<md-table-cell>Emits the <code>Event</code> object</md-table-cell>
|
||||
<md-table-cell>Triggered when the user loses focus of the input</md-table-cell>
|
||||
</md-table-row>
|
||||
</md-table-body>
|
||||
</md-table>
|
||||
</api-table>
|
||||
|
||||
<api-table name="md-autocomplete">
|
||||
|
|
|
|||
|
|
@ -68,14 +68,18 @@ export default {
|
|||
this.parentContainer.inputLength = newValue ? newValue.length : 0;
|
||||
});
|
||||
},
|
||||
onFocus() {
|
||||
onFocus(event) {
|
||||
if (this.parentContainer) {
|
||||
this.parentContainer.isFocused = true;
|
||||
}
|
||||
|
||||
this.$emit('focus', event);
|
||||
},
|
||||
onBlur() {
|
||||
onBlur(event) {
|
||||
this.parentContainer.isFocused = false;
|
||||
this.setParentValue();
|
||||
|
||||
this.$emit('blur', event);
|
||||
},
|
||||
onInput() {
|
||||
this.updateValues();
|
||||
|
|
|
|||
Loading…
Reference in a new issue