先執行輸入框顯示,再執行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)
}