Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
erich2s committed Oct 31, 2023
1 parent e3a6294 commit 526b609
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 40 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"clsx": "^1.2.1",
"framer-motion": "^10.16.4",
"lucide-react": "^0.259.0",
"next": "14.0.0",
"next": "14.0.1",
"next-auth": "^4.24.4",
"postcss": "8.4.25",
"pretty-print-json": "^2.0.4",
Expand Down
74 changes: 37 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/app/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client";
// const Map = dynamic(() => import("@/components/admin/Map"), { ssr: false });
import Map from "@/components/admin/Map";
const Map = dynamic(() => import("@/components/admin/Map"), { ssr: false });
// import Map from "@/components/admin/Map";
import UnCompletedBox from "@/components/admin/UnCompletedBox";
import { useEffect } from "react";
import { useSubscriptionStore } from "@/stores/subscriptionStore";
import dynamic from "next/dynamic";

export default function page() {
//通知订阅部分
Expand Down
3 changes: 3 additions & 0 deletions src/components/admin/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
let isFirstLoad = true;
let count = 0;

export default function Map() {
console.log("渲染map次数:", count++);
const mapRef = useRef<HTMLDivElement>(null);
// NOTE:窗口大小从父组件传下来的时候,会有延迟,导致地图高度计算错误从而有离奇的bug,所以需要在子组件中获取窗口大小
const { width, height } = useWindowSize();
Expand Down

0 comments on commit 526b609

Please sign in to comment.