watch: { //監聽表格資料的變化【使用 watch+nextTick 可以完成頁面資料監聽的 不會出現閃爍】
tableData: { //深度監聽,可監聽到對象、數組的變化
handler(val, oldVal) {
this.$nextTick(function() {
var that = this;
var thisSelTreeData = that.tableSelTreeData;
for(var j = 0; j < thisSelTreeData.length; j++) {
if(thisSelTreeData[j].data.length > 0) {
var thisHtml = "";
for(var i = 0; i < thisSelTreeData[j].data.length; i++) {
thisHtml += '
' + thisSelTreeData[j].data[i] + ' ';
}
//選中的值 渲染到頁面
$("body").find("#" + thisSelTreeData[j].treeId).parent().parent().siblings().children("div").html(thisHtml);
} else {
$("body").find("#" + thisSelTreeData[j].treeId).parent().parent().siblings().children("div").html('請選擇');
}
}
})
},
deep: true
}
},