使用级联选择器的时候出现了回显问题,接受后端传过来的值,在反给绑定的值,然后出现了下拉框选中了但是label没有显示出来,这说明传的值也没有问题,最后排查发现将值的类型改成String类型的就可以正常显示了
if (row.categoryIdOne != null && row.categoryNameOne != null) {
console.log(row)
this.selectedList = []
row.categoryIdOne = row.categoryIdOne.toString()
this.selectedList[0] = row.categoryIdOne
this.modalKey++
}
if (row.categoryIdTwo != null && row.categoryNameTwo != null) {
row.categoryIdOne = row.categoryIdOne.toString()
row.categoryIdTwo = row.categoryIdTwo.toString()
this.selectedList[0] = row.categoryIdOne
this.selectedList[1] = row.categoryIdTwo
this.modalKey++
}