| | |
| | | <template> |
| | | <section class="app-main"> |
| | | <section class="app-main" :class="{ 'business-mode': isBusiness }"> |
| | | <transition name="fade-transform" mode="out-in"> |
| | | <keep-alive :include="cachedViews"> |
| | | <router-view :key="key" /> |
| | |
| | | }, |
| | | key() { |
| | | return this.$route.path |
| | | }, |
| | | isBusiness() { |
| | | return (this.$route.matched || []).some((r) => { |
| | | const cp = r.meta && r.meta.componentPath; |
| | | if (typeof cp !== 'string' || cp.indexOf('business/') !== 0) return false; |
| | | // 业务模块的 index 列表页不需要限宽;course/index 是详情页,保留限宽 |
| | | if (/^business\/[^/]+\/index$/.test(cp) && cp !== 'business/course/index') return false; |
| | | return true; |
| | | }); |
| | | } |
| | | } |
| | | } |