rust生成html库,Electron替代方案,rust跨平台GUI框架TAURI之hello world

tauri简介

tauri 是一个新兴的跨平台GUI框架。与electron的基本思想相似,tauri的前端实现也是基于html系列语言。tauri的后端使用rust。官方形容,tauri可以创建体积更小、运行更快、更加安全的跨平台桌面应用。

详细的介绍可以自行去官网查看:

官网

Github

hello world

本人使用windows10系统。本hello world,实现了以tauri搭建桌面程序,在html页面点击按键后,由后台rust反馈信息。

效果如下:

hello world 效果图

需准备的文件

tauri 需要用到rust、nodejs,编译器可使用vscode

官方文档有比较详细的环境搭建步骤,可参阅:

https://tauri.studio/docs/getting-started/intro

其中,当搭建完环境,使用命令

yarn add tauri

安装tauri包时,可能会出现报错:

pngquant failed to build, make sure that libpng-dev is installed

此错误并不影响使用,可忽略。

程序结构

<

你可能感兴趣的:(rust生成html库)