6452597b4c
- 集成 Tailwind CSS v4.2.1 和 daisyUI v5.5.19 用于样式设计 - 添加 lucide-vue-next 图标库提供 UI 图标支持 - 配置 @tailwindcss/vite 插件进行构建优化 - 引入 Vitest v4.0.18 用于单元测试功能 - 添加 @types/node 类型定义文件支持 - 新增 tauri dev 命令用于开发环境运行
36 lines
922 B
Rust
36 lines
922 B
Rust
// 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)
|
|
}
|
|
|
|
|
|
// #[tauri::command]
|
|
// fn something(state: tauri::State<String>) -> String {
|
|
// state.inner().clone()
|
|
// }
|
|
|
|
// #[cfg(test)]
|
|
// mod tests {
|
|
// use super::something;
|
|
// use tauri::Manager;
|
|
|
|
// #[test]
|
|
// pub fn test_something() {
|
|
// let app = tauri::test::mock_app();
|
|
// app.manage("something".to_string());
|
|
// assert_eq!(&something(app.state::<String>()), "something");
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
#[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");
|
|
}
|