Skip to content

Commit 843d9dc

Browse files
committed
fix: password add focus blur methods #1485
1 parent d294328 commit 843d9dc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/input/Password.jsx

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ export default {
3131
};
3232
},
3333
methods: {
34+
focus() {
35+
this.$refs.input.focus();
36+
},
37+
blur() {
38+
this.$refs.input.blur();
39+
},
3440
onChange() {
3541
this.setState({
3642
visible: !this.visible,
@@ -85,6 +91,7 @@ export default {
8591
type: this.visible ? 'text' : 'password',
8692
},
8793
class: inputClassName,
94+
ref: 'input',
8895
on: this.$listeners,
8996
};
9097
return <Input {...inputProps} />;

0 commit comments

Comments
 (0)