fix: 修复启用禁用模块顶部没有刷新的问题
This commit is contained in:
parent
03293013ad
commit
3c8694181f
|
@ -38,6 +38,7 @@
|
||||||
import {LicenseKey} from '@/common/js/constants';
|
import {LicenseKey} from '@/common/js/constants';
|
||||||
import {mapGetters} from "vuex";
|
import {mapGetters} from "vuex";
|
||||||
import {hasLicense} from "@/common/js/utils";
|
import {hasLicense} from "@/common/js/utils";
|
||||||
|
import {MODULE_CHANGE, ModuleEvent} from "@/business/components/common/head/ListEvent";
|
||||||
|
|
||||||
const requireContext = require.context('@/business/components/xpack/', true, /router\.js$/);
|
const requireContext = require.context('@/business/components/xpack/', true, /router\.js$/);
|
||||||
const report = requireContext.keys().map(key => requireContext(key).report);
|
const report = requireContext.keys().map(key => requireContext(key).report);
|
||||||
|
@ -80,6 +81,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.registerEvents();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
|
@ -106,6 +108,15 @@ export default {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
registerEvents() {
|
||||||
|
ModuleEvent.$on(MODULE_CHANGE, () => {
|
||||||
|
if (module.default) {
|
||||||
|
module.default.listModules(this).then(() => {
|
||||||
|
this.menuKey++;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue