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