|
@@ -57,7 +57,6 @@ export default {
|
|
|
}
|
|
|
const files = this.handleFiles(this.fileTreeOriginal)
|
|
|
this.fileTree = handleTree(files, 'id', 'parentId', 'children', '/')
|
|
|
- console.log(this.fileTree, 'fileTree')
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -78,7 +77,12 @@ export default {
|
|
|
const files = []
|
|
|
// 遍历每个元素
|
|
|
for (const data of fileTreeOriginal) {
|
|
|
- const paths = data.v.split('\\')
|
|
|
+ let paths = []
|
|
|
+ if(data.v.includes("\\")){
|
|
|
+ paths = data.v.split('\\')
|
|
|
+ }else{
|
|
|
+ paths = data.v.split('/')
|
|
|
+ }
|
|
|
let fullPath = '' // 从头开始的路径,用于生成 id
|
|
|
// 遍历每个 path, 拼接成树
|
|
|
for (let i = 0; i < paths.length; i++) {
|