當(dāng)data數(shù)據(jù)更新會(huì)進(jìn)入updated生命周期函數(shù)中(以下可解決)
updated() {
this.$nextTick(() => {
this.$refs['table'].doLayout();
});
}
還有一種情況,table動(dòng)態(tài)添加列,出現(xiàn)樣式問題,同樣可以使用以上方法解決,在監(jiān)聽數(shù)據(jù)watch等,后續(xù)操作 執(zhí)行
this.$nextTick(() => {
this.$refs['table'].doLayout();
});