瀏覽代碼

[edit] input focus

wenliming 3 年之前
父節點
當前提交
603463f17f
共有 1 個文件被更改,包括 4 次插入1 次删除
  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();
     })
 }