【小程序】uni-app input IOS無法自動聚焦

先執行輸入框顯示,再執行focus

<view class="comment-input-wrap" :style="{display:(isShowCommentPanel?'block':'none')}" @click.stop>
	<input type="text" :focus="inputFocus" placeholder="請輸入評論">
</view>
/**
* 展開評論輸入框面板
*/
openCommentPanel(){
    this.$set(this,'isShowCommentPanel',true);
    setTimeout(()=>{
         this.$set(this,'inputFocus',true);
    },200)
}


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章