@@ -8,11 +8,12 @@
</template>
<script>
+ import { KEEP_ALIVE_INCLUDE } from '@/config/setting';
export default {
name: 'RouterLayout',
computed: {
include() {
- return this.$store.getters['theme/keepAliveInclude'] ?? [];
+ return KEEP_ALIVE_INCLUDE;
},
transitionName() {
return this.$store.state.theme.transitionName;
@@ -22,7 +22,10 @@ export const WHITE_LIST = ['/login', '/forget'];
// 开启 KeepAlive 后仍然不需要缓存的路由地址
export const KEEP_ALIVE_EXCLUDES = [];
-
+// 开启 KeepAlive 后需要缓存的路由地址
+export const KEEP_ALIVE_INCLUDE = [
+ 'equipmentIndex'
+];
// 直接指定菜单数据
export const USER_MENUS = undefined;
// [
@@ -36,6 +36,7 @@
import AssetTree from '@/components/AssetTree';
import EquipmentList from './components/equipment-list.vue';
+ name: 'equipmentIndex',
components: {
AssetTree,
EquipmentList
@@ -51,6 +52,7 @@
};
computed: {},
+
methods: {
handleNodeClick(info) {
console.log(info);
@@ -64,6 +66,13 @@
setRootId(id) {
this.rootId = id;
}
+ },
+ activated() {
+ this.$nextTick(() => {
+ if (this.current.id) {
+ this.$refs.listRef.sucesstion(true);
+ }
+ });
</script>