修复pgsql从数据库表获取key的问题
This commit is contained in:
+13
-11
@@ -18,17 +18,19 @@ const getRouter = async(userStore) => {
|
||||
}
|
||||
|
||||
async function handleKeepAlive(to) {
|
||||
if (to.matched && to.matched.length > 2) {
|
||||
for (let i = 1; i < to.matched.length; i++) {
|
||||
const element = to.matched[i - 1]
|
||||
if (element.name === 'layout') {
|
||||
to.matched.splice(i, 1)
|
||||
await handleKeepAlive(to)
|
||||
}
|
||||
// 如果没有按需加载完成则等待加载
|
||||
if (typeof element.components.default === 'function') {
|
||||
await element.components.default()
|
||||
await handleKeepAlive(to)
|
||||
if (to.matched.some(item => item.meta.keepAlive)) {
|
||||
if (to.matched && to.matched.length > 2) {
|
||||
for (let i = 1; i < to.matched.length; i++) {
|
||||
const element = to.matched[i - 1]
|
||||
if (element.name === 'layout') {
|
||||
to.matched.splice(i, 1)
|
||||
await handleKeepAlive(to)
|
||||
}
|
||||
// 如果没有按需加载完成则等待加载
|
||||
if (typeof element.components.default === 'function') {
|
||||
await element.components.default()
|
||||
await handleKeepAlive(to)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user