mirror of
https://github.com/lanyeeee/bilibili-video-downloader.git
synced 2026-09-07 08:36:51 +08:00
feat: 添加配置文件
This commit is contained in:
+4
-3
@@ -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
@@ -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 **/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user