feat: 添加配置文件

This commit is contained in:
lanyeeee
2025-07-10 05:52:23 +08:00
parent 1235ce1657
commit 13e07fd9b3
7 changed files with 109 additions and 8 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref } from 'vue'
import {commands} from "./bindings.ts";
import { commands } from './bindings.ts'
const greetMsg = ref('')
const name = ref('')
@@ -10,8 +10,9 @@ async function greet() {
greetMsg.value = await commands.greet(name.value)
}
function test() {
console.log('test')
async function test() {
const result = await commands.getConfig()
console.log(result)
}
</script>
+4 -1
View File
@@ -7,6 +7,9 @@
export const commands = {
async greet(name: string) : Promise<string> {
return await TAURI_INVOKE("greet", { name });
},
async getConfig() : Promise<Config> {
return await TAURI_INVOKE("get_config");
}
}
@@ -20,7 +23,7 @@ async greet(name: string) : Promise<string> {
/** user-defined types **/
export type Config = { downloadDir: string }
/** tauri-specta globals **/