菜单树结构

This commit is contained in:
闵炳辉 2024-06-27 16:40:02 +08:00
parent 7ab7b08a9a
commit cfa91d41bd
2 changed files with 16 additions and 9 deletions

View File

@ -5,9 +5,11 @@ ENV = 'development'
VITE_BASE_PATH = './' VITE_BASE_PATH = './'
# 代理配置(开发使用),必须在一行中 # 代理配置(开发使用),必须在一行中
# 本地
# VITE_APP_PROXY=[["/api","http://192.168.130.12:8080/api"]] # VITE_APP_PROXY=[["/api","http://192.168.130.12:8080/api"]]
VITE_APP_PROXY=[["/api","https://test.jsspisoft.com/api"]] # 线上
VITE_APP_PROXY=[["/api","http://192.168.109.195:8080/api"]]
# 开发环境下跨域代理请输入要跨域的api地址 - 尾部无需带'/' # 开发环境下跨域代理请输入要跨域的api地址 - 尾部无需带'/'

View File

@ -270,14 +270,19 @@ const props = {
const loadNode = (node: Node, resolve: (data: Tree[]) => void) => { const loadNode = (node: Node, resolve: (data: Tree[]) => void) => {
if (node.level === 0) { if (node.level === 0) {
return resolve([])
} }
if (node.level > 1) return resolve([]) const fromParameter = {
parentMenuId: node.data.id,
setTimeout(() => { recursive: false,
const data: Tree[] = [] }
menusTree(fromParameter)
resolve(data) .then((res: any) => {
}, 500) return resolve(res.data)
})
.catch((err) => {
console.log(err)
})
} }
// //
const input2 = ref('') const input2 = ref('')