Fixed #4219 - Password: add "@change" event
parent
5782793740
commit
880c9ce6c3
|
@ -174,11 +174,26 @@ const PasswordSlots = [
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const PasswordEmits = [
|
||||||
|
{
|
||||||
|
name: 'change',
|
||||||
|
description: 'Callback to invoke on value change.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
name: 'event',
|
||||||
|
type: 'object',
|
||||||
|
description: 'Browser event'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
password: {
|
password: {
|
||||||
name: 'Password',
|
name: 'Password',
|
||||||
description: 'Password displays strength indicator for password fields.',
|
description: 'Password displays strength indicator for password fields.',
|
||||||
props: PasswordProps,
|
props: PasswordProps,
|
||||||
slots: PasswordSlots
|
slots: PasswordSlots,
|
||||||
|
events: PasswordEmits
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -290,6 +290,11 @@ export interface PasswordEmits {
|
||||||
* @param {string} value - New value.
|
* @param {string} value - New value.
|
||||||
*/
|
*/
|
||||||
'update:modelValue'(value: string): void;
|
'update:modelValue'(value: string): void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke on value change.
|
||||||
|
* @param {Event} event - Browser event.
|
||||||
|
*/
|
||||||
|
change(event: Event): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -129,6 +129,7 @@ export default {
|
||||||
},
|
},
|
||||||
onInput(event) {
|
onInput(event) {
|
||||||
this.$emit('update:modelValue', event.target.value);
|
this.$emit('update:modelValue', event.target.value);
|
||||||
|
this.$emit('change', event);
|
||||||
},
|
},
|
||||||
onFocus(event) {
|
onFocus(event) {
|
||||||
this.focused = true;
|
this.focused = true;
|
||||||
|
|
Loading…
Reference in New Issue