diff --git a/bun.lockb b/bun.lockb index ab50a32..c3197fb 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index a91bf5c..711f7c3 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@reactuses/core": "5.0.23", "@tauri-apps/api": "2.1.0", "@tauri-apps/plugin-clipboard-manager": "2.0.0", - "@tauri-apps/plugin-dialog": "2.0.1", + "@tauri-apps/plugin-dialog": "~2", "@tauri-apps/plugin-fs": "2.0.0", "@tauri-apps/plugin-global-shortcut": "2.0.0", "@tauri-apps/plugin-http": "2.0.1", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 917ea08..05a92ab 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -23,7 +23,7 @@ tauri = { version = "2.1.0", features = [ "macos-private-api", window-vibrancy = "0.5.2" tauri-plugin-process = "2.0.1" tauri-plugin-fs = "2.0.3" -tauri-plugin-dialog = "2.0.3" +tauri-plugin-dialog = "2" tauri-plugin-os = "2.0.1" tauri-plugin-clipboard-manager = "2.0.2" tauri-plugin-shell = "2.0.2" diff --git a/src/app/page.tsx b/src/app/page.tsx index f4aad10..a4504fd 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,17 +1,27 @@ "use client" +import React from "react" import { useRouter } from "next/navigation" +import { open } from "@tauri-apps/plugin-dialog" const Home = () => { const router = useRouter() + const [file, setFile] = React.useState("") + + const openFile = async () => { + const filePath = await open({ + multiple: true, + directory: false, + }) + + setFile(filePath?.join("\n") || " ") + } return (
-

- CS 工具箱 -

+

CS 工具箱

+ +

{file}

) }