feat(project): 初始化 Tauri + Vue + TypeScript 项目
- 添加项目基础配置文件 package.json、tsconfig.json 和 vite.config.ts - 配置 Git 忽略规则 .gitignore 包含构建产物和开发环境文件 - 设置 VSCode 推荐插件 extensions.json 包含 Volar、Tauri 和 Rust 分析器 - 创建项目主页 index.html 和应用入口 src/main.ts - 添加 README.md 包含项目介绍和推荐的 IDE 设置 - 安装依赖包包括 @tauri-apps/api、vue、vue-router 等核心库 - 生成 pnpm 锁定文件 pnpm-lock.yaml 确保依赖版本一致性
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||
#[tauri::command]
|
||||
fn greet(name: &str) -> String {
|
||||
format!("Hello, {}! You've been greeted from Rust!", name)
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.invoke_handler(tauri::generate_handler![greet])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
Reference in New Issue
Block a user