添加跳转页面

This commit is contained in:
yezian 2024-08-11 10:37:52 +08:00
parent 0ee0b1baa0
commit 2728312097
1 changed files with 21 additions and 0 deletions

21
app/jump/page.js Normal file
View File

@ -0,0 +1,21 @@
"use client";
import React, { useState } from "react";
import { Button, Input } from "antd-mobile";
import { useRouter } from "next/navigation";
export default function Jump() {
const router = useRouter();
const [url, setUrl] = useState("");
return (
<section className="flex flex-1 flex-col p-4">
<Input
className="mb-2 input border-primary"
value={url}
onChange={(val) => setUrl(val)}
/>
<Button onClick={() => router.push(url)}>跳转</Button>
</section>
);
}