Browse Source

[edit] input focus

wenliming 3 years ago
parent
commit
603463f17f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/view/components/follow-input.vue

+ 4 - 1
src/view/components/follow-input.vue

@@ -149,7 +149,10 @@ const addUser = (name = '') => {
 const addInput = () => {
     addUser('');
     setTimeout(() => {
-        setIptWidth(props.atUserList.length - 1);
+        let index = props.atUserList.length - 1;
+        setIptWidth(index);
+        let iptDom = document.getElementById('input'+index);
+        iptDom.focus();
     })
 }