feat(XPack): 路由配置
This commit is contained in:
parent
032b9e16e1
commit
d40fe759a9
|
@ -29,15 +29,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||
const report = requireComponent.keys().length > 0 ? requireComponent("./report/ReportAnalysis.vue") : null;
|
||||
|
||||
const requireContext = require.context('@/business/components/xpack/', true, /router\.js$/)
|
||||
const report = requireContext.keys().map(key => requireContext(key).report);
|
||||
const isReport = report && report != null && report.length > 0 && report[0] != undefined ? true : false;
|
||||
export default {
|
||||
name: "MsTopMenus",
|
||||
data() {
|
||||
return {
|
||||
activeIndex: '/',
|
||||
isReport: report
|
||||
isReport: isReport
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -5,7 +5,10 @@ import Setting from "@/business/components/settings/router";
|
|||
import API from "@/business/components/api/router";
|
||||
import Performance from "@/business/components/performance/router";
|
||||
import Track from "@/business/components/track/router";
|
||||
|
||||
const requireContext = require.context('@/business/components/xpack/', true, /router\.js$/)
|
||||
const Report = requireContext.keys().map(key => requireContext(key).report);
|
||||
const ReportObj = Report && Report != null && Report.length > 0 && Report[0] != undefined ? Report : [{path: "/sidebar"}];
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
|
@ -22,7 +25,7 @@ const router = new VueRouter({
|
|||
API,
|
||||
Performance,
|
||||
Track,
|
||||
...requireContext.keys().map(key => requireContext(key).report),
|
||||
...ReportObj
|
||||
]
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue