Browse Source

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

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

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

@ -1,12 +1,15 @@
<template> <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> </template>
<script> <script>
export default { export default {
name:"Example",
}
name: "Example",
};
</script> </script>
<style lang="scss">
</style>
<style lang="scss"></style>

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

@ -67,11 +67,11 @@
</transition> </transition>
<transition mode="out-in" name="el-fade-in-linear"> <transition mode="out-in" name="el-fade-in-linear">
<keep-alive> <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> </keep-alive>
</transition> </transition>
<transition mode="out-in" name="el-fade-in-linear"> <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> </transition>
<BottomInfo /> <BottomInfo />
</el-main> </el-main>

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

@ -1,12 +1,15 @@
<template> <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> </template>
<script> <script>
export default { export default {
name:"SuperAdmin",
}
name: "SuperAdmin",
};
</script> </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"]; const fdTypes = ["string", "int", "bool", "float64", "time.Time"];
fdTypes.map(async fdtype => { fdTypes.map(async fdtype => {
const res = await getDict(fdtype); const res = await getDict(fdtype);
res.map(item => {
res&&res.map(item => {
this.fdMap[item.label] = fdtype; this.fdMap[item.label] = fdtype;
}); });
}); });

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

@ -1,12 +1,15 @@
<template> <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> </template>
<script> <script>
export default { export default {
name:"Workflow",
}
name: "Workflow",
};
</script> </script>
<style lang="scss">
</style>
<style lang="scss"></style>
Loading…
Cancel
Save