diff --git a/src/components/Common/Breadcrumb.vue b/src/components/Common/Breadcrumb.vue index 2649535..7aab4da 100644 --- a/src/components/Common/Breadcrumb.vue +++ b/src/components/Common/Breadcrumb.vue @@ -35,7 +35,7 @@ function findMenuItem(route) { } // 動態路由(如 /plant/:id) if ( - child.routeName === "PlantDetail" && + child.routeName === "PlantInfo" && route.path && route.path.startsWith("/plant/") ) { @@ -58,7 +58,7 @@ function buildBreadcrumb(route) { }, ]; let itemTitle = match.item.title; - if (route.name === "PlantDetail" && route.params.id) { + if (route.name === "PlantInfo" && route.params.id) { const plantNames = { "1": "四磺子坪", "2": "宜蘭大清水", diff --git a/src/constants/menuConfig.js b/src/constants/menuConfig.js index 6f771b1..c772f1e 100644 --- a/src/constants/menuConfig.js +++ b/src/constants/menuConfig.js @@ -27,21 +27,21 @@ export const menuConfig = [ id: 'plant-1', title: '四磺子坪', path: '/plant/1', - routeName: 'PlantDetail', + routeName: 'PlantInfo', params: { id: 1 } }, { id: 'plant-2', title: '宜蘭大清水', path: '/plant/2', - routeName: 'PlantDetail', + routeName: 'PlantInfo', params: { id: 2 } }, { id: 'plant-3', title: '宜蘭小清水', path: '/plant/3', - routeName: 'PlantDetail', + routeName: 'PlantInfo', params: { id: 3 } } ] diff --git a/src/router/index.js b/src/router/index.js index 585e6fa..bd1ea83 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,7 +2,7 @@ import { createRouter, createWebHashHistory } from "vue-router"; import Home from "../views/Home.vue"; import PlantsOverview from "../views/PlantsOverview.vue"; import PlantReport from "../views/PlantReport.vue"; -import PlantDetail from "../views/PlantDetail.vue"; +import PlantInfo from "../views/PlantInfo.vue"; const routes = [ { @@ -29,8 +29,8 @@ const routes = [ }, { path: "/plant/:id", - name: "PlantDetail", - component: PlantDetail, + name: "PlantInfo", + component: PlantInfo, meta: { title: "電廠詳細", menuGroup: "factory-info", diff --git a/src/views/PlantDetail.vue b/src/views/PlantInfo.vue similarity index 100% rename from src/views/PlantDetail.vue rename to src/views/PlantInfo.vue