修改数据来源
This commit is contained in:
@@ -34,19 +34,19 @@ const deviceTree = ref([])
|
||||
const activeName = ref('1')
|
||||
const key = ref(0)
|
||||
getDeviceTree().then(res => {
|
||||
res.data.forEach((item: any) => {
|
||||
item.value = item.id
|
||||
item.label = item.name
|
||||
item.children.forEach((child: any) => {
|
||||
child.value = child.id
|
||||
child.label = child.name
|
||||
child.children.forEach((grand: any) => {
|
||||
grand.value = grand.id
|
||||
grand.label = grand.name
|
||||
delete grand.children
|
||||
})
|
||||
})
|
||||
})
|
||||
// res.data.forEach((item: any) => {
|
||||
// item.value = item.id
|
||||
// item.label = item.name
|
||||
// item.children.forEach((child: any) => {
|
||||
// child.value = child.id
|
||||
// child.label = child.name
|
||||
// child.children.forEach((grand: any) => {
|
||||
// grand.value = grand.id
|
||||
// grand.label = grand.name
|
||||
// delete grand.children
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
deviceTree.value = res.data
|
||||
key.value += 1
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user