Browse Source

修复了子路由模式下两个keepalive相互切换 keepalive失效的问题

main
pixel 4 years ago
parent
commit
6a0a763a96
  1. 13
      web/src/view/example/index.vue
  2. 4
      web/src/view/layout/index.vue
  3. 13
      web/src/view/superAdmin/index.vue
  4. 2
      web/src/view/systemTools/autoCode/index.vue
  5. 13
      web/src/view/workflow/index.vue

13
web/src/view/example/index.vue

@ -1,12 +1,15 @@
<template>
<router-view></router-view>
<div>
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view>
</div>
</template>
<script>
export default {
name: "Example",
}
};
</script>
<style lang="scss">
</style>
<style lang="scss"></style>

4
web/src/view/layout/index.vue

@ -67,11 +67,11 @@
</transition>
<transition mode="out-in" name="el-fade-in-linear">
<keep-alive>
<router-view :key="$route.fullPath" v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box" v-if="$route.meta.keepAlive && reloadFlag"></router-view>
<router-view v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box" v-if="$route.meta.keepAlive && reloadFlag"></router-view>
</keep-alive>
</transition>
<transition mode="out-in" name="el-fade-in-linear">
<router-view :key="$route.fullPath" v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box" v-if="!$route.meta.keepAlive && reloadFlag"></router-view>
<router-view v-loading="loadingFlag" element-loading-text="正在加载中" class="admin-box" v-if="!$route.meta.keepAlive && reloadFlag"></router-view>
</transition>
<BottomInfo />
</el-main>

13
web/src/view/superAdmin/index.vue

@ -1,12 +1,15 @@
<template>
<router-view></router-view>
<div>
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view>
</div>
</template>
<script>
export default {
name: "SuperAdmin",
}
};
</script>
<style lang="scss">
</style>
<style lang="scss"></style>

2
web/src/view/systemTools/autoCode/index.vue

@ -357,7 +357,7 @@ export default {
const fdTypes = ["string", "int", "bool", "float64", "time.Time"];
fdTypes.map(async fdtype => {
const res = await getDict(fdtype);
res.map(item => {
res&&res.map(item => {
this.fdMap[item.label] = fdtype;
});
});

13
web/src/view/workflow/index.vue

@ -1,12 +1,15 @@
<template>
<router-view></router-view>
<div>
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view>
</div>
</template>
<script>
export default {
name: "Workflow",
}
};
</script>
<style lang="scss">
</style>
<style lang="scss"></style>
Loading…
Cancel
Save