超管后台 - 将整个前端部分页面处理id的方式,由使用 params.id 的方式全部迁移到 React.use(params) 这种方式

This commit is contained in:
柳清爽
2025-04-22 18:23:58 +08:00
parent c18a81e22d
commit 793ee5cb4f
7 changed files with 477 additions and 422 deletions

View File

@@ -1,7 +1,7 @@
"use client"
import type React from "react"
import { useState, useEffect } from "react"
import { useState, useEffect, use } from "react"
import { useRouter } from "next/navigation"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
@@ -18,7 +18,7 @@ interface Device {
}
export default function EditProjectPage({ params }: { params: { id: string } }) {
const id = params.id
const { id } = use(params)
const router = useRouter()
const [isSubmitting, setIsSubmitting] = useState(false)