Fixed #4219 - Password: add "@change" event

pull/4239/head
Tuğçe Küçükoğlu 2023-08-02 12:27:43 +03:00
parent 5782793740
commit 880c9ce6c3
3 changed files with 22 additions and 1 deletions

View File

@ -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
} }
}; };

View File

@ -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;
} }
/** /**

View File

@ -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;