{"id":1959,"date":"2026-06-19T13:06:26","date_gmt":"2026-06-19T05:06:26","guid":{"rendered":"https:\/\/blog.ttwow.top\/?p=1959"},"modified":"2026-06-19T21:17:35","modified_gmt":"2026-06-19T13:17:35","slug":"tauri-tailwind-css-%e6%a1%8c%e9%9d%a2%e7%ab%af%e5%ba%94%e7%94%a8%e5%bc%80%e5%8f%91%e5%85%a8%e6%b5%81%e7%a8%8b%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/blog.ttwow.top\/?p=1959","title":{"rendered":"Tauri + Tailwind CSS \u684c\u9762\u7aef\u5e94\u7528\u5f00\u53d1\u5168\u6d41\u7a0b\u5165\u95e8\u6559\u7a0b"},"content":{"rendered":"<p>\u672c\u6559\u7a0b\u4e13\u95e8\u4e3a\u96f6\u57fa\u7840\u3001\u6216\u521a\u63a5\u89e6\u684c\u9762\u7aef\u5f00\u53d1\u7684\u540c\u5b66\u7f16\u5199\u3002\u901a\u8fc7\u672c\u7bc7\u6559\u7a0b\uff0c\u4f60\u5c06\u80fd\u591f\u4ece\u96f6\u5f00\u59cb\u642d\u5efa\u73af\u5883\u3001\u7406\u89e3\u5e95\u5c42\u67b6\u6784\u3001\u8fd0\u884c\u5e76\u6253\u5305\u51fa\u4e00\u4e2a\u9ad8\u6027\u80fd\u3001\u8d85\u5c0f\u4f53\u79ef\u7684\u684c\u9762\u7aef\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<h2>\u4e00\u3001 \u6280\u672f\u6808\u7b80\u4ecb<\/h2>\n<p>\u5728\u672c\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u7ec4\u5408\u4f7f\u7528\u4e86\u76ee\u524d\u5168\u6808\u5f00\u53d1\u4e2d\u6700\u4e3b\u6d41\u3001\u6700\u9ad8\u6548\u7684\u51e0\u9879\u6280\u672f\uff1a<\/p>\n<ol>\n<li><strong>Tauri (\u684c\u9762\u7aef\u6838\u5fc3\u6846\u67b6)<\/strong>\n<ul>\n<li><strong>\u4f5c\u7528<\/strong>\uff1a\u8d1f\u8d23\u628a\u7f51\u9875\u7aef\u7a0b\u5e8f\u201c\u53d8\u6210\u201d\u684c\u9762\u7aef\u8f6f\u4ef6\u3002<\/li>\n<li><strong>\u7279\u70b9<\/strong>\uff1a\u5b83\u662f Electron \u7684\u4e0b\u4e00\u4ee3\u98a0\u8986\u8005\u3002Electron \u4f1a\u5728\u5b89\u88c5\u5305\u91cc\u585e\u8fdb\u4e00\u4e2a\u5b8c\u6574\u7684\u8c37\u6b4c\u6d4f\u89c8\u5668\uff08\u5bfc\u81f4\u8f6f\u4ef6\u4f53\u79ef\u52a8\u8f84\u51e0\u767e MB\uff0c\u5403\u5185\u5b58\uff09\uff0c\u800c <strong>Tauri \u4e0d\u81ea\u5e26\u6d4f\u89c8\u5668<\/strong>\u3002\u5b83\u76f4\u63a5\u8c03\u7528\u4f60\u7535\u8111\u7cfb\u7edf\u81ea\u5e26\u7684\u6d4f\u89c8\u5668\u5185\u6838\uff08Windows \u5185\u90e8\u8c03\u7528 Edge WebView2\uff0cMac \u8c03\u7528 Safari WebKit\uff09\uff0c\u56e0\u6b64\u6253\u5305\u51fa\u6765\u7684\u8f6f\u4ef6\u901a\u5e38\u53ea\u6709\u5341\u51e0 MB\uff0c\u8fd0\u884c\u6781\u5feb\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>Rust (\u540e\u7aef\u7f16\u8bd1\u4e0e\u5e95\u5c42\u63a7\u5236)<\/strong>\n<ul>\n<li><strong>\u4f5c\u7528<\/strong>\uff1a\u4f5c\u4e3a\u8f6f\u4ef6\u7684\u540e\u7aef\u3002<\/li>\n<li><strong>\u7279\u70b9<\/strong>\uff1a\u666e\u901a\u7684\u7f51\u9875 JS \u4ee3\u7801\u7531\u4e8e\u5b89\u5168\u6c99\u7bb1\u9650\u5236\uff0c\u662f\u65e0\u6cd5\u76f4\u63a5\u8bfb\u53d6\u7528\u6237 C \u76d8\u6587\u4ef6\u3001\u8c03\u7528\u5e95\u5c42\u786c\u4ef6\u6216\u6ce8\u518c\u5168\u5c40\u5feb\u6377\u952e\u7684\u3002Rust \u62e5\u6709\u6781\u9ad8\u7684\u64cd\u4f5c\u7cfb\u7edf\u6743\u9650\uff0c\u5b83\u5145\u5f53\u201c\u5e55\u540e\u6267\u6cd5\u4eba\u201d\uff0c\u524d\u7aef\u9700\u8981\u8bfb\u5199\u6587\u4ef6\u6216\u8fdb\u884c\u9ad8\u7ea7\u64cd\u4f5c\u65f6\uff0c\u901a\u8fc7\u901a\u4fe1\u53d1\u9001\u7ed9 Rust\uff0c\u7531 Rust \u6765\u5b89\u5168\u3001\u9ad8\u6548\u5730\u5b8c\u6210\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>Vite + Vue 3 \/ React (\u524d\u7aef\u5de5\u7a0b\u5316\u6846\u67b6)<\/strong>\n<ul>\n<li><strong>\u4f5c\u7528<\/strong>\uff1a\u8d1f\u8d23\u6784\u5efa\u4f60\u7684\u524d\u7aef\u9875\u9762\u3002Vite \u662f\u76ee\u524d\u901f\u5ea6\u6700\u5feb\u7684\u524d\u7aef\u6784\u5efa\u5de5\u5177\uff0c\u8d1f\u8d23\u5c06\u4f60\u7684\u7f51\u9875\u4ee3\u7801\u538b\u7f29\u3001\u6253\u5305\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>Tailwind CSS (\u539f\u5b50\u5316\u6837\u5f0f\u6846\u67b6)<\/strong>\n<ul>\n<li><strong>\u4f5c\u7528<\/strong>\uff1a\u8d1f\u8d23\u754c\u9762\u7684\u6781\u81f4\u7f8e\u5316\u3002<\/li>\n<li><strong>\u7279\u70b9<\/strong>\uff1a\u65e0\u9700\u518d\u5199\u5355\u72ec\u7684 <code>.css<\/code> \u6587\u4ef6\u3002\u4f60\u53ea\u9700\u8981\u5728 HTML \u7684 <code>class<\/code> \u5c5e\u6027\u91cc\u5199\u7b80\u5199\u7c7b\u540d\uff08\u4f8b\u5982 <code>class=&quot;flex p-4 bg-blue-500 rounded-lg&quot;<\/code>\uff09\uff0c\u5c31\u80fd\u77ac\u95f4\u62fc\u88c5\u51fa\u7cbe\u7f8e\u7684\u201c\u82f9\u679c\u98ce\u201d\u6216\u201c\u6781\u7b80\u98ce\u201d\u73b0\u4ee3 UI \u754c\u9762\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2>\u4e8c\u3001 \u6838\u5fc3\u67b6\u6784\u4e0e\u6280\u672f\u5173\u7cfb<\/h2>\n<p>\u5728 Tauri \u9879\u76ee\u4e2d\uff0c\u5e94\u7528\u88ab\u5212\u5206\u4e3a<strong>\u4e24\u4e2a\u6838\u5fc3\u4e3b\u8fdb\u7a0b<\/strong>\uff0c\u5b83\u4eec\u5206\u5de5\u660e\u786e\uff1a<\/p>\n<ol>\n<li><strong>\u524d\u7aef\uff08\u6e32\u67d3\u8fdb\u7a0b - Webview\uff09<\/strong>\uff1a\u7531 HTML\/JS\/CSS\uff08\u57fa\u4e8e Vite + Tailwind\uff09\u6784\u6210\u3002\u4f60\u5728\u5c4f\u5e55\u4e0a\u770b\u5230\u7684\u6309\u94ae\u3001\u6587\u5b57\u3001\u52a8\u753b\u90fd\u5728\u8fd9\u91cc\u6e32\u67d3\u3002\u5b83\u8fd0\u884c\u5728\u7cfb\u7edf\u81ea\u5e26\u7684 WebView \u5185\u6838\u4e2d\u3002<\/li>\n<li><strong>\u540e\u7aef\uff08\u4e3b\u8fdb\u7a0b - Rust Core\uff09<\/strong>\uff1a\u7531 Rust \u7f16\u5199\u3002\u8d1f\u8d23\u548c\u64cd\u4f5c\u7cfb\u7edf\u76f4\u63a5\u6253\u4ea4\u9053\uff08\u5982\u6587\u4ef6\u5b58\u50a8\u3001\u7cfb\u7edf\u6258\u76d8\u3001\u7f51\u7edc\u8bf7\u6c42\u3001\u901a\u77e5\u7b49\uff09\u3002<\/li>\n<li><strong>\u901a\u4fe1\u6865\u6881\uff08IPC - \u8fdb\u7a0b\u95f4\u901a\u4fe1\uff09<\/strong>\uff1a\u524d\u7aef\u548c\u540e\u7aef\u901a\u8fc7 Tauri \u63d0\u4f9b\u7684\u547d\u4ee4\u673a\u5236\uff08<code>invoke<\/code>\uff09\u8fdb\u884c\u5f02\u6b65\u901a\u4fe1\u3002\u524d\u7aef\u53d1\u9001\u6307\u4ee4\uff0cRust \u6267\u884c\u5b8c\u540e\u5c06\u7ed3\u679c\u8fd4\u56de\u7ed9\u524d\u7aef\u3002<\/li>\n<\/ol>\n<h2>\u4e09\u3001 \u5f00\u53d1\u73af\u5883\u5b89\u88c5\uff08\u4e00\u6b21\u6027\u914d\u7f6e\uff09<\/h2>\n<p>\u5728\u4e00\u5207\u5f00\u59cb\u4e4b\u524d\uff0c\u4f60\u7684\u7535\u8111\u9700\u8981\u5177\u5907\u8fd0\u884c\u548c\u7f16\u8bd1\u524d\u7aef\u53ca Rust \u540e\u7aef\u7684\u80fd\u529b\u3002<\/p>\n<h3>1. \u524d\u7aef\u73af\u5883\uff1a\u5b89\u88c5 Node.js<\/h3>\n<ul>\n<li>\n<p><strong>\u4e0b\u8f7d<\/strong>\uff1a\u524d\u5f80 <a href=\"https:\/\/nodejs.org\/\">Node.js \u5b98\u7f51<\/a> \u4e0b\u8f7d\u957f\u671f\u652f\u6301\u7248\uff08LTS\uff09\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1<\/strong>\uff1a\u6253\u5f00\u7ec8\u7aef\uff08CMD \u6216 PowerShell\uff09\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u770b\u5230\u7248\u672c\u53f7\u5373\u4ee3\u8868\u6210\u529f\uff1a<\/p>\n<p>Bash<\/p>\n<pre><code>node -v\nnpm -v<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>2. \u540e\u7aef\u73af\u5883\uff1a\u5b89\u88c5 Rust \u53ca C++ \u7f16\u8bd1\u5de5\u5177\uff08Windows \u7cfb\u7edf\uff09<\/h3>\n<p>Rust \u7f16\u8bd1\u51fa Windows \u7684 <code>.exe<\/code> \u7a0b\u5e8f\u9700\u8981\u4f9d\u8d56\u5fae\u8f6f\u7684 C++ \u7f16\u8bd1\u73af\u5883\u3002<\/p>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7d\u5e76\u5b89\u88c5 Visual Studio \u6784\u5efa\u5de5\u5177<\/strong>\uff1a<\/p>\n<ul>\n<li>\u524d\u5f80 <a href=\"https:\/\/www.google.com\/search?q=https:\/\/visualstudio.microsoft.com\/zh-hans\/visual-cpp-build-tools\/\">\u5fae\u8f6f\u5b98\u7f51<\/a> \u4e0b\u8f7d <strong>Visual Studio Build Tools<\/strong>\u3002<\/li>\n<li>\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\uff0c\u5728\u5f39\u51fa\u7684\u5de5\u4f5c\u8d1f\u8f7d\u52fe\u9009\u754c\u9762\uff0c<strong>\u5fc5\u987b\u52fe\u9009\u201c\u4f7f\u7528 C++ \u7684\u684c\u9762\u5f00\u53d1\u201d<\/strong>\uff0c\u7136\u540e\u70b9\u51fb\u5b89\u88c5\u5e76\u91cd\u542f\u7535\u8111\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5 Rust \u8bed\u8a00\u73af\u5883<\/strong>\uff1a<\/p>\n<ul>\n<li>\u524d\u5f80 <a href=\"https:\/\/www.rust-lang.org\/zh-CN\/tools\/install\">Rust \u5b98\u7f51<\/a> \u4e0b\u8f7d <code>rustup-init.exe<\/code> \u5e76\u8fd0\u884c\u3002<\/li>\n<li>\u7ec8\u7aef\u5f39\u51fa\u9009\u9879\u65f6\uff0c\u8f93\u5165 <code>1<\/code>\uff08\u9009\u62e9\u9ed8\u8ba4\u7684 <code>default<\/code> \u5b89\u88c5\uff09\u5e76\u56de\u8f66\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1 Rust \u73af\u5883<\/strong>\uff1a<\/p>\n<ul>\n<li>\n<p>\u91cd\u65b0\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\uff1a<\/p>\n<p>Bash<\/p>\n<pre><code>rustc --version\ncargo --version<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>3. \u56fd\u5185\u7f51\u7edc\u52a0\u901f\u914d\u7f6e\uff08\u2605 \u6781\u5176\u91cd\u8981\uff09<\/h3>\n<p>\u7531\u4e8e Rust \u5b98\u65b9\u670d\u52a1\u5668\u5728\u56fd\u5916\uff0c\u56fd\u5185\u7f51\u7edc\u76f4\u63a5\u4e0b\u8f7d\u4f9d\u8d56\u5305\u6781\u6613\u5361\u6b7b\u6216\u62a5\u9519\uff08\u4f8b\u5982\u62a5 <code>failed to get serde<\/code> \u7b49\u9519\u8bef\uff09\u3002<strong>\u5728\u5f00\u53d1\u524d\u5fc5\u987b\u914d\u7f6e\u56fd\u5185\u7a00\u758f\u7d22\u5f15\u955c\u50cf<\/strong>\u3002<\/p>\n<ol>\n<li>\n<p>\u6309\u4e0b\u5feb\u6377\u952e <code>Win + R<\/code>\uff0c\u8f93\u5165 <code>%USERPROFILE%\\.cargo<\/code> \u5e76\u56de\u8f66\u3002<\/p>\n<\/li>\n<li>\n<p>\u5728\u6253\u5f00\u7684\u76ee\u5f55\u4e0b\uff0c\u65b0\u5efa\u4e00\u4e2a\u6587\u672c\u6587\u6863\uff0c\u5c06\u5176\u91cd\u547d\u540d\u4e3a <strong><code>config.toml<\/code><\/strong>\u3002 <em>(\u26a0\ufe0f \u6ce8\u610f\uff1a\u786e\u4fdd\u5b83\u7684\u540e\u7f00\u662f <code>.toml<\/code>\uff0c\u800c\u4e0d\u662f <code>config.toml.txt<\/code>)<\/em><\/p>\n<\/li>\n<li>\n<p>\u7528\u8bb0\u4e8b\u672c\u6253\u5f00\u5b83\uff0c\u5c06\u4ee5\u4e0b\u5185\u5bb9\u590d\u5236\u8fdb\u53bb\u5e76\u4fdd\u5b58\uff08<strong>\u6ce8\u610f\u672b\u5c3e\u7684\u659c\u6760\u4e0d\u53ef\u7701\u7565<\/strong>\uff09\uff1a<\/p>\n<p>Ini, TOML<\/p>\n<pre><code>[source.crates-io]\nreplace-with = 'ustc'\n\n[source.ustc]\nregistry = \"sparse+https:\/\/mirrors.ustc.edu.cn\/crates.io-index\/\"\n\n[net]\ngit-fetch-with-cli = true<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2>\u56db\u3001 \u9879\u76ee\u521d\u59cb\u5316\u4e0e\u642d\u5efa<\/h2>\n<h3>1. \u521b\u5efa Tauri \u9879\u76ee<\/h3>\n<p>\u5728\u4f60\u60f3\u5b58\u653e\u9879\u76ee\u7684\u6587\u4ef6\u5939\u4e0b\u6253\u5f00\u7ec8\u7aef\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>Bash<\/p>\n<pre><code>npm create tauri-app@latest<\/code><\/pre>\n<p>\u6309\u7167\u63d0\u793a\u8fdb\u884c\u9009\u62e9\uff08\u63a8\u8350\u9009\u62e9\uff09\uff1a<\/p>\n<ul>\n<li><code>Project name<\/code>: \u8f93\u5165\u4f60\u7684\u9879\u76ee\u540d\uff08\u5982 <code>local-toolbox<\/code>\uff09<\/li>\n<li><code>Identifier<\/code>: \u8f93\u5165\u5e94\u7528\u6807\u8bc6\u7b26\uff08<strong>\u26a0\ufe0f\u6ce8\u610f\uff1a\u4e0d\u8981\u4ee5 <code>.app<\/code> \u7ed3\u5c3e<\/strong>\uff0c\u4f8b\u5982\u8f93\u5165 <code>com.toolbox.dev<\/code>\uff09<\/li>\n<li><code>Choose which language to use for your frontend<\/code>: \u9009\u62e9 <code>TypeScript \/ JavaScript<\/code><\/li>\n<li><code>Choose your package manager<\/code>: \u9009\u62e9 <code>npm<\/code><\/li>\n<li><code>Choose your UI framework<\/code>: \u9009\u62e9 <code>Vue<\/code> \u6216 <code>React<\/code><\/li>\n<li><code>Choose your Vite template<\/code>: \u9009\u62e9\u5bf9\u5e94\u7684 <code>Vue<\/code> \u6216 <code>React<\/code> \u6a21\u677f<\/li>\n<\/ul>\n<h3>2. \u521d\u59cb\u5316 Tailwind CSS<\/h3>\n<p>\u8fdb\u5165\u521a\u521a\u521b\u5efa\u597d\u7684\u9879\u76ee\u6839\u76ee\u5f55\uff1a<\/p>\n<p>Bash<\/p>\n<pre><code>cd local-toolbox<\/code><\/pre>\n<p>\u5b89\u88c5 Tailwind CSS \u53ca\u5176\u4f9d\u8d56\u9879\uff1a<\/p>\n<p>Bash<\/p>\n<pre><code>npm install -D tailwindcss postcss autoprefixer\nnpx tailwindcss init -p<\/code><\/pre>\n<p>\u4fee\u6539\u6839\u76ee\u5f55\u4e0b\u7684 <code>tailwind.config.js<\/code> \u6587\u4ef6\uff0c\u914d\u7f6e\u8981\u5e94\u7528\u6837\u5f0f\u7684\u6587\u4ef6\u8def\u5f84\uff1a<\/p>\n<p>JavaScript<\/p>\n<pre><code>\/** @type {import(&#039;tailwindcss&#039;).Config} *\/\nexport default {\n  content: [\n    &quot;.\/index.html&quot;,\n    &quot;.\/src\/**\/*.{js,ts,jsx,tsx,vue}&quot;,\n  ],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}<\/code><\/pre>\n<p>\u5728\u4f60\u7684\u524d\u7aef\u4e3b\u6837\u5f0f\u6587\u4ef6\uff08\u4f8b\u5982 <code>src\/style.css<\/code> \u6216 <code>src\/assets\/main.css<\/code>\uff09\u7684\u6700\u9876\u90e8\uff0c\u5f15\u5165 Tailwind \u7684\u4e09\u5c42\u6838\u5fc3\u6307\u4ee4\uff0c\u5c06\u5176\u539f\u6709\u5185\u5bb9\u6e05\u7a7a\u5e76\u66ff\u6362\u4e3a\uff1a<\/p>\n<p>CSS<\/p>\n<pre><code>@tailwind base;\n@tailwind components;\n@tailwind utilities;<\/code><\/pre>\n<h2>\u4e94\u3001 \u9879\u76ee\u76ee\u5f55\u7ed3\u6784\u4ecb\u7ecd<\/h2>\n<p>\u4e00\u4e2a\u6807\u51c6\u7684 Tauri \u9879\u76ee\u76ee\u5f55\u7ed3\u6784\u5982\u4e0b\uff0c\u5f00\u53d1\u65f6\u4f60\u53ea\u9700\u8981\u5173\u6ce8 <code>src<\/code> \u548c <code>src-tauri<\/code>\uff1a<\/p>\n<p>Plaintext<\/p>\n<pre><code>local-toolbox\/\n\u251c\u2500\u2500 src\/                      &lt;-- \u3010\u524d\u7aef\u6838\u5fc3\u3011\n\u2502   \u251c\u2500\u2500 assets\/               &lt;-- \u524d\u7aef\u9759\u6001\u8d44\u6e90\uff08\u56fe\u7247\u3001\u6837\u5f0f\u7b49\uff09\n\u2502   \u251c\u2500\u2500 components\/           &lt;-- \u524d\u7aef UI \u7ec4\u4ef6\n\u2502   \u251c\u2500\u2500 App.vue \/ App.tsx     &lt;-- \u7f51\u9875\u6839\u7ec4\u4ef6\uff08\u5728\u6b64\u5904\u7f16\u5199\u4f60\u7684\u5de5\u5177\u754c\u9762\uff09\n\u2502   \u2514\u2500\u2500 main.js \/ main.ts     &lt;-- \u524d\u7aef\u5165\u53e3\u6587\u4ef6\n\u251c\u2500\u2500 src-tauri\/                &lt;-- \u3010\u540e\u7aef\u6838\u5fc3\uff08Rust\uff09\u3011\n\u2502   \u251c\u2500\u2500 icons\/                &lt;-- \u8f6f\u4ef6\u684c\u9762\u56fe\u6807\uff08\u6253\u5305\u65f6\u5fc5\u7528\uff09\n\u2502   \u251c\u2500\u2500 src\/\n\u2502   \u2502   \u2514\u2500\u2500 main.rs           &lt;-- Rust \u5165\u53e3\u6587\u4ef6\uff08\u7f16\u5199\u5e95\u5c42\u903b\u8f91\u3001\u7a97\u53e3\u63a7\u5236\u7684\u5730\u65b9\uff09\n\u2502   \u251c\u2500\u2500 Cargo.toml            &lt;-- Rust \u7684\u4f9d\u8d56\u7ba1\u7406\u914d\u7f6e\u6587\u4ef6\n\u2502   \u2514\u2500\u2500 tauri.conf.json       &lt;-- \u3010\u5168\u5c40\u914d\u7f6e\u3011\u914d\u7f6e\u8f6f\u4ef6\u540d\u3001\u7a97\u53e3\u5927\u5c0f\u3001\u6253\u5305\u53c2\u6570\u7b49\n\u251c\u2500\u2500 dist\/                     &lt;-- \u3010\u4e34\u65f6\u4ea7\u7269\u3011\u524d\u7aef\u7f51\u9875\u7f16\u8bd1\u540e\u7684\u9759\u6001\u6587\u4ef6\u5939\n\u251c\u2500\u2500 package.json              &lt;-- \u524d\u7aef\u4f9d\u8d56\u7ba1\u7406\u914d\u7f6e\u6587\u4ef6\n\u2514\u2500\u2500 index.html                &lt;-- \u7f51\u9875\u4e3b\u5165\u53e3<\/code><\/pre>\n<h2>\u516d\u3001 \u5e38\u7528\u5f00\u53d1\u4e0e\u6784\u5efa\u547d\u4ee4<\/h2>\n<p>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u6253\u5f00\u7ec8\u7aef\uff0c\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u64cd\u7eb5\u4f60\u7684\u9879\u76ee\uff1a<\/p>\n<h3>1. \u5b89\u88c5\u524d\u7aef\u4f9d\u8d56<\/h3>\n<p>\u5728\u65b0\u62c9\u53d6\u9879\u76ee\u6216\u66f4\u6362\u7535\u8111\u540e\u6267\u884c\uff1a<\/p>\n<p>Bash<\/p>\n<pre><code>npm install<\/code><\/pre>\n<h3>2. \u542f\u52a8\u5f00\u53d1\u6a21\u5f0f\uff08\u5b9e\u65f6\u9884\u89c8\uff09<\/h3>\n<p>Bash<\/p>\n<pre><code>npm run tauri dev<\/code><\/pre>\n<ul>\n<li><strong>\u6548\u679c<\/strong>\uff1a\u7cfb\u7edf\u4f1a\u7f16\u8bd1 Rust \u5e76\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u684c\u9762\u7a97\u53e3\u3002<\/li>\n<li><strong>\u7279\u6027<\/strong>\uff1a\u652f\u6301<strong>\u70ed\u66f4\u65b0<\/strong>\u3002\u4f60\u5728\u524d\u7aef\u4ee3\u7801\uff08<code>src\/<\/code> \u5185\u90e8\uff09\u4fee\u6539\u4efb\u4f55\u754c\u9762\u6216 Tailwind \u6837\u5f0f\uff0c\u4fdd\u5b58\u540e\u684c\u9762\u7a97\u53e3\u91cc\u7684\u754c\u9762\u4f1a\u5b9e\u65f6\u5237\u65b0\uff0c\u65e0\u9700\u91cd\u65b0\u7f16\u8bd1\u3002<\/li>\n<\/ul>\n<h3>3. \u751f\u6210\u6b63\u5f0f\u6253\u5305\u6587\u4ef6<\/h3>\n<p>Bash<\/p>\n<pre><code>npm run tauri build<\/code><\/pre>\n<ul>\n<li><strong>\u6548\u679c<\/strong>\uff1a\n<ol>\n<li>\u81ea\u52a8\u6267\u884c\u524d\u7aef\u6253\u5305\uff0c\u5728 <code>dist\/<\/code> \u751f\u6210\u9759\u6001\u7f51\u9875\u3002<\/li>\n<li>\u542f\u52a8 Rust \u751f\u4ea7\u73af\u5883\u7f16\u8bd1\uff0c\u628a\u7f51\u9875\u65e0\u7f1d\u5185\u5d4c\u5230\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u3002<\/li>\n<li>\u6700\u7ec8\u5728 <code>src-tauri\/target\/release\/<\/code> \u4e0b\u751f\u6210\u7eff\u8272\u7248 <code>.exe<\/code>\u3002<\/li>\n<li>\u8c03\u7528\u6253\u5305\u5de5\u5177\u751f\u6210\u5b89\u88c5\u5305\u3002<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h2>\u4e03\u3001 \u5e38\u89c1\u907f\u5751\u6307\u5357\uff08\u65b0\u624b\u5fc5\u770b\uff09<\/h2>\n<h3>1. \u8b66\u544a\uff1aBundle identifier ends with <code>.app<\/code><\/h3>\n<ul>\n<li><strong>\u539f\u56e0<\/strong>\uff1a\u5728 <code>tauri.conf.json<\/code> \u4e2d\u914d\u7f6e\u7684 <code>identifier<\/code> \u7c7b\u4f3c\u4e8e <code>com.toolbox.app<\/code>\u3002\u56e0\u4e3a <code>.app<\/code> \u5728 macOS \u7cfb\u7edf\u4e2d\u662f\u5408\u6cd5\u7684\u8f6f\u4ef6\u540e\u7f00\u540d\uff0c\u51b2\u7a81\u4f1a\u5bfc\u81f4 Mac \u73af\u5883\u6253\u5305\u5931\u8d25\u3002<\/li>\n<li><strong>\u89e3\u51b3<\/strong>\uff1a\u6253\u5f00 <code>src-tauri\/tauri.conf.json<\/code>\uff0c\u5c06 <code>&quot;identifier&quot;: &quot;com.toolbox.app&quot;<\/code> \u4fee\u6539\u4e3a <code>&quot;identifier&quot;: &quot;com.toolbox.dev&quot;<\/code> \u5373\u53ef\u3002<\/li>\n<\/ul>\n<h3>2. \u5361\u6b7b\u5728 <code>Blocking waiting for file lock on package cache<\/code><\/h3>\n<ul>\n<li><strong>\u539f\u56e0<\/strong>\uff1a\u4e4b\u524d\u7684\u7f16\u8bd1\u8fdb\u7a0b\u5f02\u5e38\u9501\u6b7b\uff0c\u6216\u8005\u6709\u591a\u4e2a\u7ec8\u7aef\u540c\u65f6\u5728\u8dd1\u7f16\u8bd1\uff0c\u5bfc\u81f4 Rust \u7684\u7f13\u5b58\u6587\u4ef6\u88ab\u9501\u4f4f\u3002<\/li>\n<li><strong>\u89e3\u51b3<\/strong>\uff1a\u6253\u5f00\u4efb\u52a1\u7ba1\u7406\u5668\uff0c\u6740\u6389\u6240\u6709\u5e26\u6709 <code>cargo.exe<\/code> \u6216 <code>rustc.exe<\/code> \u7684\u8fdb\u7a0b\u3002\u6216\u8005\u524d\u5f80 <code>C:\\Users\\\u4f60\u7684\u7528\u6237\u540d\\.cargo\\<\/code> \u76ee\u5f55\u4e0b\uff0c\u5220\u9664\u540d\u4e3a <code>.package-cache<\/code> \u7684\u9501\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h3>3. \u6253\u5305\u5361\u6b7b\u5728 <code>Downloading https:\/\/github.com\/wixtoolset\/...<\/code><\/h3>\n<ul>\n<li><strong>\u539f\u56e0<\/strong>\uff1aTauri \u5728\u6700\u540e\u4e00\u6b65\u9ed8\u8ba4\u5c1d\u8bd5\u5c06\u8f6f\u4ef6\u6253\u5305\u6210 <code>.msi<\/code> \u5b89\u88c5\u5305\uff0c\u8fd9\u9700\u8981\u4e0b\u8f7d\u5fae\u8f6f\u7684 WiX \u5de5\u5177\u94fe\uff0c\u7531\u4e8e GitHub \u5728\u56fd\u5185\u8bbf\u95ee\u6781\u5176\u4e0d\u7a33\u5b9a\u800c\u5bfc\u81f4\u5361\u6b7b\u3002<\/li>\n<li><strong>\u7ec8\u6781\u89e3\u51b3\u65b9\u6848\uff08\u6539\u7528\u66f4\u8f7b\u91cf\u73b0\u4ee3\u7684 NSIS \u6253\u5305\uff0c\u751f\u6210 exe \u5b89\u88c5\u5305\uff09<\/strong>\uff1a\n<ol>\n<li>\u6253\u5f00 <code>src-tauri\/tauri.conf.json<\/code>\u3002<\/li>\n<li>\u627e\u5230 <code>&quot;bundle&quot;<\/code> \u4e0b\u7684 <code>&quot;targets&quot;: &quot;all&quot;<\/code>\u3002<\/li>\n<li>\u5c06\u5176\u4fee\u6539\u4e3a\uff1a<code>&quot;targets&quot;: [&quot;nsis&quot;]<\/code>\u3002<\/li>\n<li>\u91cd\u65b0\u8fd0\u884c <code>npm run tauri build<\/code>\u3002NSIS \u4f9d\u8d56\u4e0b\u8f7d\u6781\u5feb\uff0c\u4f1a\u81ea\u52a8\u4e3a\u4f60\u751f\u6210\u7cbe\u7f8e\u7684 <code>\u9879\u76ee\u540d_x64-setup.exe<\/code> \u4e00\u952e\u5b89\u88c5\u5305\u3002<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h2>\u516b\u3001 \u8f6f\u4ef6\u4f7f\u7528\u540e\uff0c\u672c\u5730\u6570\u636e\u548c\u914d\u7f6e\u6587\u4ef6\u5b58\u5728\u54ea\u91cc\uff1f<\/h2>\n<p>\u5982\u679c\u4f60\u5728\u524d\u7aef\u4f7f\u7528\u4e86\u6700\u5e38\u7528\u7684\u7f51\u9875\u5b58\u50a8\u65b9\u5f0f\uff08\u5982 <code>localStorage<\/code> \u6216 <code>IndexedDB<\/code>\uff09\u6765\u5b58\u50a8\u7528\u6237\u7684\u5361\u7247\u3001\u6587\u672c\u3001\u914d\u7f6e\u6570\u636e\uff0c\u5f53\u7528\u6237\u5b89\u88c5\u5e76\u8fd0\u884c\u4f60\u7684\u684c\u9762\u7aef\u8f6f\u4ef6\u540e\uff0c\u8fd9\u4e9b\u6570\u636e\u5e76\u4e0d\u4f1a\u968f\u8f6f\u4ef6\u5173\u95ed\u800c\u6d88\u5931\u3002<\/p>\n<p>\u5b83\u4eec\u88ab\u5b89\u5168\u5730\u6258\u7ba1\u5728 Windows \u7cfb\u7edf\u7684 Edge WebView2 \u72ec\u7acb\u7528\u6237\u6570\u636e\u6587\u4ef6\u5939\uff08UDF\uff09\u4e2d\u3002\u5177\u4f53\u5b58\u653e\u8def\u5f84\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\n<p>\u6309\u4e0b\u5feb\u6377\u952e <code>Win + R<\/code>\uff0c\u8f93\u5165 <strong><code>%LOCALAPPDATA%<\/code><\/strong> \u5e76\u56de\u8f66\u3002<\/p>\n<\/li>\n<li>\n<p>\u627e\u5230\u4f60\u5728\u9879\u76ee\u91cc\u8bbe\u7f6e\u7684\u8f6f\u4ef6\u6807\u8bc6\u7b26\u6587\u4ef6\u5939\uff08\u4f8b\u5982 <code>com.toolbox.dev<\/code> \u6216\u8005\u662f\u4f60\u7684\u9879\u76ee\u540d\u79f0\uff09\u3002<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u7684\u786e\u5207\u7269\u7406\u4f4d\u7f6e\u4f4d\u4e8e\uff1a<\/p>\n<p>Plaintext<\/p>\n<pre><code>%LOCALAPPDATA%\\[\u4f60\u7684\u5e94\u7528\u6807\u8bc6\u7b26]\\EBWebView\\Default\\Local Storage\\leveldb\\<\/code><\/pre>\n<p><em>\u5373\u4f7f\u4f60\u540e\u7eed\u4e3a\u8f6f\u4ef6\u8986\u76d6\u5b89\u88c5\u5347\u7ea7\u7248\u672c\uff0c\u53ea\u8981\u8fd9\u4e2a\u76ee\u5f55\u4e0d\u88ab\u624b\u52a8\u6e05\u7a7a\uff0c\u7528\u6237\u7684\u672c\u5730\u914d\u7f6e\u6570\u636e\u5c31\u7edd\u4e0d\u4f1a\u4e22\u5931\uff01<\/em><\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6559\u7a0b\u4e13\u95e8\u4e3a\u96f6\u57fa\u7840\u3001\u6216\u521a\u63a5\u89e6\u684c\u9762\u7aef\u5f00\u53d1\u7684\u540c\u5b66\u7f16\u5199\u3002\u901a\u8fc7\u672c\u7bc7\u6559\u7a0b\uff0c\u4f60\u5c06\u80fd\u591f\u4ece\u96f6\u5f00\u59cb\u642d\u5efa\u73af\u5883\u3001\u7406\u89e3\u5e95\u5c42\u67b6\u6784\u3001\u8fd0\u884c\u5e76 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[130],"tags":[167],"class_list":["post-1959","post","type-post","status-publish","format-standard","hentry","category-linux-ops","tag-tauri"],"_links":{"self":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/1959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1959"}],"version-history":[{"count":1,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/1959\/revisions"}],"predecessor-version":[{"id":1960,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/1959\/revisions\/1960"}],"wp:attachment":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}