WXL
2026-09-17 3df460667d74868d0a54fce12d5e881bbd6c0c1a
src/layout/components/AppMain.vue
@@ -1,5 +1,5 @@
<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" />
@@ -17,6 +17,15 @@
    },
    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;
      });
    }
  }
}