From 880c9ce6c3b4768abf47a751f11bc7fb0dd13c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 2 Aug 2023 12:27:43 +0300 Subject: [PATCH] Fixed #4219 - Password: add "@change" event --- api-generator/components/password.js | 17 ++++++++++++++++- components/lib/password/Password.d.ts | 5 +++++ components/lib/password/Password.vue | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/api-generator/components/password.js b/api-generator/components/password.js index a5fde3cb5..8fc8b489f 100644 --- a/api-generator/components/password.js +++ b/api-generator/components/password.js @@ -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 = { password: { name: 'Password', description: 'Password displays strength indicator for password fields.', props: PasswordProps, - slots: PasswordSlots + slots: PasswordSlots, + events: PasswordEmits } }; diff --git a/components/lib/password/Password.d.ts b/components/lib/password/Password.d.ts index 1e6377899..de707df29 100755 --- a/components/lib/password/Password.d.ts +++ b/components/lib/password/Password.d.ts @@ -290,6 +290,11 @@ export interface PasswordEmits { * @param {string} value - New value. */ 'update:modelValue'(value: string): void; + /** + * Callback to invoke on value change. + * @param {Event} event - Browser event. + */ + change(event: Event): void; } /** diff --git a/components/lib/password/Password.vue b/components/lib/password/Password.vue index 8a5304535..768a80fa3 100755 --- a/components/lib/password/Password.vue +++ b/components/lib/password/Password.vue @@ -129,6 +129,7 @@ export default { }, onInput(event) { this.$emit('update:modelValue', event.target.value); + this.$emit('change', event); }, onFocus(event) { this.focused = true;