環境上的問題
win10 IE11.657.18362 版本11.0.175 KB4537767
第一個問題 el-date-picker和el-time-picker綁定的值不顯示
<el-date-picker ref='_date1' v-model="form.date"
:format="dateFormat" type="date" placeholder="选择日期"></el-date-picker>
賦值時
this.form.date = params.rundate
測試發現_this.$refs._date1.$children[0].$refs.input.value的值為空
因此做了特殊處理
if (this.form.date && !_this.$refs._date1.$children[0].$refs.input.value) {
_this.$refs._date1.$children[0].$refs.input.value = this.form.date
}
第二個問題 input輸入框無法輸入中文
原因是獲取焦點改變input的readOnly屬性時被延遲,移除readonly后再focus一次