vue Element學習和問題處理

1. resetForm內容沒有徹底被重置
在使用resetForm時,會還原數據到初始化data時的值,有時會出現值已修改,但頁面無刷新變化。
添加:
this.$nextTick(() => {
  this.resetForm(type);
});

將form的賦值寫在後面。this

若是仍是不行,就將賦值寫在spa

this.$nextTick(function(){****});
2. 編輯時,部分組件賦值有問題,例如autoComplate選擇值後沒法自動帶入到內容框,須要點擊其它按鈕觸發。  
this.form = res.data; //直接從遠端獲取內容,給this.form有時不行,form中有一些其它的內容,
Object.assign(this.form, res.data);  //可以使用這種形式傳遞對象內容

 3. 樹展開和摺疊code

for(var i=0;i<this.$refs.treeX.store._getAllNodes().length;i++){
           this.$refs.treeX.store._getAllNodes()[i].expanded=this.isexpand;
        }

4. 校驗未清除orm

 this.$refs.menuform.clearValidate();

5. 有時select元素選擇後沒法選中,或者其它一些賦值後,頁面沒有刷新,有可能值太深,致使沒有觸發upload,可強制使用刷新。對象

this.$forceUpdate();

 6. 日期控件clearable不起做用blog

 要使用   :clearable="false"  才能夠get

相關文章
相關標籤/搜索