From ee5616ce9bcea85a610e7ce77840080582ad4141 Mon Sep 17 00:00:00 2001 From: zhangjiming Date: Fri, 21 Mar 2025 09:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4route=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 6 +-- src/components/konva/MeasurementCanvas.tsx | 4 +- src/index.tsx | 60 +++++++++++------------------- 3 files changed, 26 insertions(+), 44 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index e8c02d7..82f0720 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Outlet, useLocation, useNavigate } from 'react-router'; -import { NavBar, SafeArea, TabBar } from 'antd-mobile'; +import { SafeArea, TabBar } from 'antd-mobile'; import icon_1_s from './assets/tabIcon/icon_tab1_s.svg'; import icon_1_u from './assets/tabIcon/icon_tab1_u.svg'; @@ -52,7 +52,7 @@ const BottomBar = () => { - active ? : + active ? icon : icon } title={item.title} /> @@ -68,7 +68,7 @@ function App() {
-
+
diff --git a/src/components/konva/MeasurementCanvas.tsx b/src/components/konva/MeasurementCanvas.tsx index a65b95a..c6b7bd4 100644 --- a/src/components/konva/MeasurementCanvas.tsx +++ b/src/components/konva/MeasurementCanvas.tsx @@ -360,12 +360,12 @@ const MeasurementCanvas = forwardRef + ); const yAxisStart = transform({ x: 0, y: logicalExtent.minY }); const yAxisEnd = transform({ x: 0, y: logicalExtent.maxY }); lines.push( - + ); return lines; }; diff --git a/src/index.tsx b/src/index.tsx index 14dd949..2385326 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,52 +5,35 @@ import App from './App'; import reportWebVitals from './reportWebVitals'; import { createHashRouter, - Navigate, + createRoutesFromElements, + Route, RouterProvider, -} from "react-router-dom"; +} from 'react-router-dom'; import Measure from './pages/Measure'; import Setting from './pages/Setting'; import Bluetooth from './pages/Bluetooth'; import Mine from './pages/Mine'; import MeasureSave from './pages/MeasureSave'; +import MeasureRecord from './pages/MeasureRecord'; -const router = createHashRouter([ - { - path: "/", - element: - }, - { - path: "/home", - element: , - children: [ - { - path: "measure", - element: - }, - { - path: "setting", - element: - }, - { - path: "bluetooth", - element: - }, - { - path: "mine", - element: - } - ] - }, - { - path: "/measure/save", - element: - } -]); - - -const root = ReactDOM.createRoot( - document.getElementById('root') as HTMLElement +const router = createHashRouter( + createRoutesFromElements( + + }> + }> + }> + }> + }> + + + }> + }> + + + ) ); + +const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); root.render( @@ -61,4 +44,3 @@ root.render( // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals reportWebVitals(); -