From 843d9dc82fe88a31d3c18af0384b9b1bc19e23ac Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 9 Dec 2019 22:44:52 +0800 Subject: [PATCH] fix: password add focus blur methods #1485 --- components/input/Password.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/input/Password.jsx b/components/input/Password.jsx index 1eceddbab..e0d435744 100644 --- a/components/input/Password.jsx +++ b/components/input/Password.jsx @@ -31,6 +31,12 @@ export default { }; }, methods: { + focus() { + this.$refs.input.focus(); + }, + blur() { + this.$refs.input.blur(); + }, onChange() { this.setState({ visible: !this.visible, @@ -85,6 +91,7 @@ export default { type: this.visible ? 'text' : 'password', }, class: inputClassName, + ref: 'input', on: this.$listeners, }; return ;