From abd5ff9043dd3411ea1f573a377e426fad08ff7e Mon Sep 17 00:00:00 2001 From: tjz <415800467@qq.com> Date: Sun, 10 Jun 2018 10:26:03 +0800 Subject: [PATCH] fix: add textarea autofocus --- components/input/TextArea.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/input/TextArea.jsx b/components/input/TextArea.jsx index 4c2106cb9..2fdd2800d 100644 --- a/components/input/TextArea.jsx +++ b/components/input/TextArea.jsx @@ -55,7 +55,12 @@ export default { }, }, mounted () { - this.resizeTextarea() + this.$nextTick(() => { + this.resizeTextarea() + if (this.autoFocus) { + this.focus() + } + }) }, methods: { handleKeyDown (e) {