├── .gitignore ├── .vscode └── extensions.json ├── LICENSE ├── README.md ├── app-icon.png ├── index.html ├── package-lock.json ├── package.json ├── public ├── tauri.svg └── vite.svg ├── src-tauri ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── build.rs ├── capabilities │ └── default.json ├── icons │ ├── 128x128.png │ ├── 128x128@2x.png │ ├── 32x32.png │ ├── Square107x107Logo.png │ ├── Square142x142Logo.png │ ├── Square150x150Logo.png │ ├── Square284x284Logo.png │ ├── Square30x30Logo.png │ ├── Square310x310Logo.png │ ├── Square44x44Logo.png │ ├── Square71x71Logo.png │ ├── Square89x89Logo.png │ ├── StoreLogo.png │ ├── icon.icns │ ├── icon.ico │ └── icon.png ├── src │ ├── lib.rs │ └── main.rs └── tauri.conf.json ├── src ├── App.vue ├── assets │ ├── app.png │ ├── iconfont │ │ ├── iconfont.css │ │ ├── iconfont.js │ │ ├── iconfont.json │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ └── iconfont.woff2 │ └── vue.svg ├── components │ ├── layout │ │ ├── header │ │ │ └── index.vue │ │ ├── index.vue │ │ ├── main │ │ │ └── index.vue │ │ └── side │ │ │ └── index.vue │ └── system │ │ └── index.vue ├── main.js ├── plugins │ ├── index.js │ └── modules │ │ ├── element.js │ │ ├── iconfont.js │ │ └── router.js ├── router │ └── index.js ├── tray.js └── views │ ├── home │ └── index.vue │ └── search │ └── index.vue └── vite.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | .vscode 14 | *.local 15 | 16 | # Editor directories and files 17 | .vscode/* 18 | !.vscode/extensions.json 19 | .idea 20 | .DS_Store 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw? 26 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "Vue.volar", 4 | "tauri-apps.tauri-vscode", 5 | "rust-lang.rust-analyzer" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Young 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tauri + Vue 3 + Element Plus 版本 2 | 3 | 该源码可帮助你快速开始一个Tauri + Vue 3的项目,采用Vue 3 ` 12 | 13 | 14 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tauri-vue-app", 3 | "version": "1.0.1", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "tauri-vue-app", 9 | "version": "1.0.1", 10 | "dependencies": { 11 | "@tauri-apps/api": "^2.0.0", 12 | "@tauri-apps/plugin-dialog": "^2.2.1", 13 | "@tauri-apps/plugin-shell": "^2.2.0", 14 | "element-plus": "^2.2.28", 15 | "vue": "^3.2.45", 16 | "vue-router": "^4.1.6" 17 | }, 18 | "devDependencies": { 19 | "@tauri-apps/cli": "^2.4.1", 20 | "@vitejs/plugin-vue": "^4.0.0", 21 | "sass": "^1.57.1", 22 | "vite": "^4.2.1" 23 | } 24 | }, 25 | "node_modules/@babel/parser": { 26 | "version": "7.20.7", 27 | "license": "MIT", 28 | "bin": { 29 | "parser": "bin/babel-parser.js" 30 | }, 31 | "engines": { 32 | "node": ">=6.0.0" 33 | } 34 | }, 35 | "node_modules/@ctrl/tinycolor": { 36 | "version": "3.5.0", 37 | "license": "MIT", 38 | "engines": { 39 | "node": ">=10" 40 | } 41 | }, 42 | "node_modules/@element-plus/icons-vue": { 43 | "version": "2.0.10", 44 | "license": "MIT", 45 | "peerDependencies": { 46 | "vue": "^3.2.0" 47 | } 48 | }, 49 | "node_modules/@esbuild/win32-x64": { 50 | "version": "0.17.19", 51 | "cpu": [ 52 | "x64" 53 | ], 54 | "dev": true, 55 | "license": "MIT", 56 | "optional": true, 57 | "os": [ 58 | "win32" 59 | ], 60 | "engines": { 61 | "node": ">=12" 62 | } 63 | }, 64 | "node_modules/@floating-ui/core": { 65 | "version": "1.1.0", 66 | "license": "MIT" 67 | }, 68 | "node_modules/@floating-ui/dom": { 69 | "version": "1.1.0", 70 | "license": "MIT", 71 | "dependencies": { 72 | "@floating-ui/core": "^1.0.5" 73 | } 74 | }, 75 | "node_modules/@popperjs/core": { 76 | "name": "@sxzz/popperjs-es", 77 | "version": "2.11.7", 78 | "license": "MIT", 79 | "funding": { 80 | "type": "opencollective", 81 | "url": "https://opencollective.com/popperjs" 82 | } 83 | }, 84 | "node_modules/@tauri-apps/api": { 85 | "version": "2.0.0", 86 | "resolved": "https://registry.npmmirror.com/@tauri-apps/api/-/api-2.0.0.tgz", 87 | "integrity": "sha512-moKgCp2EX7X5GiOx/G/bmoEpkFQVVmyS98UaJU4xUVzan+E1BdwlAKcbip+cGldshYOqL4JSwAEN1OkRXeug0Q==", 88 | "funding": { 89 | "type": "opencollective", 90 | "url": "https://opencollective.com/tauri" 91 | } 92 | }, 93 | "node_modules/@tauri-apps/cli": { 94 | "version": "2.4.1", 95 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli/-/cli-2.4.1.tgz", 96 | "integrity": "sha512-9Ta81jx9+57FhtU/mPIckDcOBtPTUdKM75t4+aA0X84b8Sclb0jy1xA8NplmcRzp2fsfIHNngU2NiRxsW5+yOQ==", 97 | "dev": true, 98 | "bin": { 99 | "tauri": "tauri.js" 100 | }, 101 | "engines": { 102 | "node": ">= 10" 103 | }, 104 | "funding": { 105 | "type": "opencollective", 106 | "url": "https://opencollective.com/tauri" 107 | }, 108 | "optionalDependencies": { 109 | "@tauri-apps/cli-darwin-arm64": "2.4.1", 110 | "@tauri-apps/cli-darwin-x64": "2.4.1", 111 | "@tauri-apps/cli-linux-arm-gnueabihf": "2.4.1", 112 | "@tauri-apps/cli-linux-arm64-gnu": "2.4.1", 113 | "@tauri-apps/cli-linux-arm64-musl": "2.4.1", 114 | "@tauri-apps/cli-linux-riscv64-gnu": "2.4.1", 115 | "@tauri-apps/cli-linux-x64-gnu": "2.4.1", 116 | "@tauri-apps/cli-linux-x64-musl": "2.4.1", 117 | "@tauri-apps/cli-win32-arm64-msvc": "2.4.1", 118 | "@tauri-apps/cli-win32-ia32-msvc": "2.4.1", 119 | "@tauri-apps/cli-win32-x64-msvc": "2.4.1" 120 | } 121 | }, 122 | "node_modules/@tauri-apps/cli-darwin-arm64": { 123 | "version": "2.4.1", 124 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.4.1.tgz", 125 | "integrity": "sha512-QME7s8XQwy3LWClTVlIlwXVSLKkeJ/z88pr917Mtn9spYOjnBfsgHAgGdmpWD3NfJxjg7CtLbhH49DxoFL+hLg==", 126 | "cpu": [ 127 | "arm64" 128 | ], 129 | "dev": true, 130 | "optional": true, 131 | "os": [ 132 | "darwin" 133 | ], 134 | "engines": { 135 | "node": ">= 10" 136 | } 137 | }, 138 | "node_modules/@tauri-apps/cli-darwin-x64": { 139 | "version": "2.4.1", 140 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.4.1.tgz", 141 | "integrity": "sha512-/r89IcW6Ya1sEsFUEH7wLNruDTj7WmDWKGpPy7gATFtQr5JEY4heernqE82isjTUimnHZD8SCr0jA3NceI4ybw==", 142 | "cpu": [ 143 | "x64" 144 | ], 145 | "dev": true, 146 | "optional": true, 147 | "os": [ 148 | "darwin" 149 | ], 150 | "engines": { 151 | "node": ">= 10" 152 | } 153 | }, 154 | "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { 155 | "version": "2.4.1", 156 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.4.1.tgz", 157 | "integrity": "sha512-9tDijkRB+CchAGjXxYdY9l/XzFpLp1yihUtGXJz9eh+3qIoRI043n3e+6xmU8ZURr7XPnu+R4sCmXs6HD+NCEQ==", 158 | "cpu": [ 159 | "arm" 160 | ], 161 | "dev": true, 162 | "optional": true, 163 | "os": [ 164 | "linux" 165 | ], 166 | "engines": { 167 | "node": ">= 10" 168 | } 169 | }, 170 | "node_modules/@tauri-apps/cli-linux-arm64-gnu": { 171 | "version": "2.4.1", 172 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.4.1.tgz", 173 | "integrity": "sha512-pnFGDEXBAzS4iDYAVxTRhAzNu3K2XPGflYyBc0czfHDBXopqRgMyj5Q9Wj7HAwv6cM8BqzXINxnb2ZJFGmbSgA==", 174 | "cpu": [ 175 | "arm64" 176 | ], 177 | "dev": true, 178 | "optional": true, 179 | "os": [ 180 | "linux" 181 | ], 182 | "engines": { 183 | "node": ">= 10" 184 | } 185 | }, 186 | "node_modules/@tauri-apps/cli-linux-arm64-musl": { 187 | "version": "2.4.1", 188 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.4.1.tgz", 189 | "integrity": "sha512-Hp0zXgeZNKmT+eoJSCxSBUm2QndNuRxR55tmIeNm3vbyUMJN/49uW7nurZ5fBPsacN4Pzwlx1dIMK+Gnr9A69w==", 190 | "cpu": [ 191 | "arm64" 192 | ], 193 | "dev": true, 194 | "optional": true, 195 | "os": [ 196 | "linux" 197 | ], 198 | "engines": { 199 | "node": ">= 10" 200 | } 201 | }, 202 | "node_modules/@tauri-apps/cli-linux-riscv64-gnu": { 203 | "version": "2.4.1", 204 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.4.1.tgz", 205 | "integrity": "sha512-3T3bo2E4fdYRvzcXheWUeQOVB+LunEEi92iPRgOyuSVexVE4cmHYl+MPJF+EUV28Et0hIVTsHibmDO0/04lAFg==", 206 | "cpu": [ 207 | "riscv64" 208 | ], 209 | "dev": true, 210 | "optional": true, 211 | "os": [ 212 | "linux" 213 | ], 214 | "engines": { 215 | "node": ">= 10" 216 | } 217 | }, 218 | "node_modules/@tauri-apps/cli-linux-x64-gnu": { 219 | "version": "2.4.1", 220 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.4.1.tgz", 221 | "integrity": "sha512-kLN0FdNONO+2i+OpU9+mm6oTGufRC00e197TtwjpC0N6K2K8130w7Q3FeODIM2CMyg0ov3tH+QWqKW7GNhHFzg==", 222 | "cpu": [ 223 | "x64" 224 | ], 225 | "dev": true, 226 | "optional": true, 227 | "os": [ 228 | "linux" 229 | ], 230 | "engines": { 231 | "node": ">= 10" 232 | } 233 | }, 234 | "node_modules/@tauri-apps/cli-linux-x64-musl": { 235 | "version": "2.4.1", 236 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.4.1.tgz", 237 | "integrity": "sha512-a8exvA5Ub9eg66a6hsMQKJIkf63QAf9OdiuFKOsEnKZkNN2x0NLgfvEcqdw88VY0UMs9dBoZ1AGbWMeYnLrLwQ==", 238 | "cpu": [ 239 | "x64" 240 | ], 241 | "dev": true, 242 | "optional": true, 243 | "os": [ 244 | "linux" 245 | ], 246 | "engines": { 247 | "node": ">= 10" 248 | } 249 | }, 250 | "node_modules/@tauri-apps/cli-win32-arm64-msvc": { 251 | "version": "2.4.1", 252 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.4.1.tgz", 253 | "integrity": "sha512-4JFrslsMCJQG1c573T9uqQSAbF3j/tMKkMWzsIssv8jvPiP++OG61A2/F+y9te9/Q/O95cKhDK63kaiO5xQaeg==", 254 | "cpu": [ 255 | "arm64" 256 | ], 257 | "dev": true, 258 | "optional": true, 259 | "os": [ 260 | "win32" 261 | ], 262 | "engines": { 263 | "node": ">= 10" 264 | } 265 | }, 266 | "node_modules/@tauri-apps/cli-win32-ia32-msvc": { 267 | "version": "2.4.1", 268 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.4.1.tgz", 269 | "integrity": "sha512-9eXfFORehYSCRwxg2KodfmX/mhr50CI7wyBYGbPLePCjr5z0jK/9IyW6r0tC+ZVjwpX48dkk7hKiUgI25jHjzA==", 270 | "cpu": [ 271 | "ia32" 272 | ], 273 | "dev": true, 274 | "optional": true, 275 | "os": [ 276 | "win32" 277 | ], 278 | "engines": { 279 | "node": ">= 10" 280 | } 281 | }, 282 | "node_modules/@tauri-apps/cli-win32-x64-msvc": { 283 | "version": "2.4.1", 284 | "resolved": "https://registry.npmmirror.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.4.1.tgz", 285 | "integrity": "sha512-60a4Ov7Jrwqz2hzDltlS7301dhSAmM9dxo+IRBD3xz7yobKrgaHXYpWvnRomYItHcDd51VaKc9292H8/eE/gsw==", 286 | "cpu": [ 287 | "x64" 288 | ], 289 | "dev": true, 290 | "optional": true, 291 | "os": [ 292 | "win32" 293 | ], 294 | "engines": { 295 | "node": ">= 10" 296 | } 297 | }, 298 | "node_modules/@tauri-apps/plugin-dialog": { 299 | "version": "2.2.1", 300 | "resolved": "https://registry.npmmirror.com/@tauri-apps/plugin-dialog/-/plugin-dialog-2.2.1.tgz", 301 | "integrity": "sha512-wZmCouo4PgTosh/UoejPw9DPs6RllS5Pp3fuOV2JobCu36mR5AXU2MzU9NZiVaFi/5Zfc8RN0IhcZHnksJ1o8A==", 302 | "dependencies": { 303 | "@tauri-apps/api": "^2.0.0" 304 | } 305 | }, 306 | "node_modules/@tauri-apps/plugin-shell": { 307 | "version": "2.2.0", 308 | "resolved": "https://registry.npmmirror.com/@tauri-apps/plugin-shell/-/plugin-shell-2.2.0.tgz", 309 | "integrity": "sha512-iC3Ic1hLmasoboG7BO+7p+AriSoqAwKrIk+Hpk+S/bjTQdXqbl2GbdclghI4gM32X0bls7xHzIFqhRdrlvJeaA==", 310 | "dependencies": { 311 | "@tauri-apps/api": "^2.0.0" 312 | } 313 | }, 314 | "node_modules/@types/lodash": { 315 | "version": "4.14.191", 316 | "license": "MIT" 317 | }, 318 | "node_modules/@types/lodash-es": { 319 | "version": "4.17.6", 320 | "license": "MIT", 321 | "dependencies": { 322 | "@types/lodash": "*" 323 | } 324 | }, 325 | "node_modules/@types/web-bluetooth": { 326 | "version": "0.0.16", 327 | "license": "MIT" 328 | }, 329 | "node_modules/@vitejs/plugin-vue": { 330 | "version": "4.0.0", 331 | "dev": true, 332 | "license": "MIT", 333 | "engines": { 334 | "node": "^14.18.0 || >=16.0.0" 335 | }, 336 | "peerDependencies": { 337 | "vite": "^4.0.0", 338 | "vue": "^3.2.25" 339 | } 340 | }, 341 | "node_modules/@vue/compiler-core": { 342 | "version": "3.2.45", 343 | "license": "MIT", 344 | "dependencies": { 345 | "@babel/parser": "^7.16.4", 346 | "@vue/shared": "3.2.45", 347 | "estree-walker": "^2.0.2", 348 | "source-map": "^0.6.1" 349 | } 350 | }, 351 | "node_modules/@vue/compiler-dom": { 352 | "version": "3.2.45", 353 | "license": "MIT", 354 | "dependencies": { 355 | "@vue/compiler-core": "3.2.45", 356 | "@vue/shared": "3.2.45" 357 | } 358 | }, 359 | "node_modules/@vue/compiler-sfc": { 360 | "version": "3.2.45", 361 | "license": "MIT", 362 | "dependencies": { 363 | "@babel/parser": "^7.16.4", 364 | "@vue/compiler-core": "3.2.45", 365 | "@vue/compiler-dom": "3.2.45", 366 | "@vue/compiler-ssr": "3.2.45", 367 | "@vue/reactivity-transform": "3.2.45", 368 | "@vue/shared": "3.2.45", 369 | "estree-walker": "^2.0.2", 370 | "magic-string": "^0.25.7", 371 | "postcss": "^8.1.10", 372 | "source-map": "^0.6.1" 373 | } 374 | }, 375 | "node_modules/@vue/compiler-ssr": { 376 | "version": "3.2.45", 377 | "license": "MIT", 378 | "dependencies": { 379 | "@vue/compiler-dom": "3.2.45", 380 | "@vue/shared": "3.2.45" 381 | } 382 | }, 383 | "node_modules/@vue/devtools-api": { 384 | "version": "6.4.5", 385 | "license": "MIT" 386 | }, 387 | "node_modules/@vue/reactivity": { 388 | "version": "3.2.45", 389 | "license": "MIT", 390 | "dependencies": { 391 | "@vue/shared": "3.2.45" 392 | } 393 | }, 394 | "node_modules/@vue/reactivity-transform": { 395 | "version": "3.2.45", 396 | "license": "MIT", 397 | "dependencies": { 398 | "@babel/parser": "^7.16.4", 399 | "@vue/compiler-core": "3.2.45", 400 | "@vue/shared": "3.2.45", 401 | "estree-walker": "^2.0.2", 402 | "magic-string": "^0.25.7" 403 | } 404 | }, 405 | "node_modules/@vue/runtime-core": { 406 | "version": "3.2.45", 407 | "license": "MIT", 408 | "dependencies": { 409 | "@vue/reactivity": "3.2.45", 410 | "@vue/shared": "3.2.45" 411 | } 412 | }, 413 | "node_modules/@vue/runtime-dom": { 414 | "version": "3.2.45", 415 | "license": "MIT", 416 | "dependencies": { 417 | "@vue/runtime-core": "3.2.45", 418 | "@vue/shared": "3.2.45", 419 | "csstype": "^2.6.8" 420 | } 421 | }, 422 | "node_modules/@vue/server-renderer": { 423 | "version": "3.2.45", 424 | "license": "MIT", 425 | "dependencies": { 426 | "@vue/compiler-ssr": "3.2.45", 427 | "@vue/shared": "3.2.45" 428 | }, 429 | "peerDependencies": { 430 | "vue": "3.2.45" 431 | } 432 | }, 433 | "node_modules/@vue/shared": { 434 | "version": "3.2.45", 435 | "license": "MIT" 436 | }, 437 | "node_modules/@vueuse/core": { 438 | "version": "9.10.0", 439 | "license": "MIT", 440 | "dependencies": { 441 | "@types/web-bluetooth": "^0.0.16", 442 | "@vueuse/metadata": "9.10.0", 443 | "@vueuse/shared": "9.10.0", 444 | "vue-demi": "*" 445 | }, 446 | "funding": { 447 | "url": "https://github.com/sponsors/antfu" 448 | } 449 | }, 450 | "node_modules/@vueuse/metadata": { 451 | "version": "9.10.0", 452 | "license": "MIT", 453 | "funding": { 454 | "url": "https://github.com/sponsors/antfu" 455 | } 456 | }, 457 | "node_modules/@vueuse/shared": { 458 | "version": "9.10.0", 459 | "license": "MIT", 460 | "dependencies": { 461 | "vue-demi": "*" 462 | }, 463 | "funding": { 464 | "url": "https://github.com/sponsors/antfu" 465 | } 466 | }, 467 | "node_modules/anymatch": { 468 | "version": "3.1.3", 469 | "dev": true, 470 | "license": "ISC", 471 | "dependencies": { 472 | "normalize-path": "^3.0.0", 473 | "picomatch": "^2.0.4" 474 | }, 475 | "engines": { 476 | "node": ">= 8" 477 | } 478 | }, 479 | "node_modules/async-validator": { 480 | "version": "4.2.5", 481 | "license": "MIT" 482 | }, 483 | "node_modules/binary-extensions": { 484 | "version": "2.2.0", 485 | "dev": true, 486 | "license": "MIT", 487 | "engines": { 488 | "node": ">=8" 489 | } 490 | }, 491 | "node_modules/braces": { 492 | "version": "3.0.2", 493 | "dev": true, 494 | "license": "MIT", 495 | "dependencies": { 496 | "fill-range": "^7.0.1" 497 | }, 498 | "engines": { 499 | "node": ">=8" 500 | } 501 | }, 502 | "node_modules/chokidar": { 503 | "version": "3.5.3", 504 | "dev": true, 505 | "funding": [ 506 | { 507 | "type": "individual", 508 | "url": "https://paulmillr.com/funding/" 509 | } 510 | ], 511 | "license": "MIT", 512 | "dependencies": { 513 | "anymatch": "~3.1.2", 514 | "braces": "~3.0.2", 515 | "glob-parent": "~5.1.2", 516 | "is-binary-path": "~2.1.0", 517 | "is-glob": "~4.0.1", 518 | "normalize-path": "~3.0.0", 519 | "readdirp": "~3.6.0" 520 | }, 521 | "engines": { 522 | "node": ">= 8.10.0" 523 | }, 524 | "optionalDependencies": { 525 | "fsevents": "~2.3.2" 526 | } 527 | }, 528 | "node_modules/csstype": { 529 | "version": "2.6.21", 530 | "license": "MIT" 531 | }, 532 | "node_modules/dayjs": { 533 | "version": "1.11.7", 534 | "license": "MIT" 535 | }, 536 | "node_modules/element-plus": { 537 | "version": "2.2.28", 538 | "license": "MIT", 539 | "dependencies": { 540 | "@ctrl/tinycolor": "^3.4.1", 541 | "@element-plus/icons-vue": "^2.0.6", 542 | "@floating-ui/dom": "^1.0.1", 543 | "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", 544 | "@types/lodash": "^4.14.182", 545 | "@types/lodash-es": "^4.17.6", 546 | "@vueuse/core": "^9.1.0", 547 | "async-validator": "^4.2.5", 548 | "dayjs": "^1.11.3", 549 | "escape-html": "^1.0.3", 550 | "lodash": "^4.17.21", 551 | "lodash-es": "^4.17.21", 552 | "lodash-unified": "^1.0.2", 553 | "memoize-one": "^6.0.0", 554 | "normalize-wheel-es": "^1.2.0" 555 | }, 556 | "peerDependencies": { 557 | "vue": "^3.2.0" 558 | } 559 | }, 560 | "node_modules/esbuild": { 561 | "version": "0.17.19", 562 | "dev": true, 563 | "hasInstallScript": true, 564 | "license": "MIT", 565 | "bin": { 566 | "esbuild": "bin/esbuild" 567 | }, 568 | "engines": { 569 | "node": ">=12" 570 | }, 571 | "optionalDependencies": { 572 | "@esbuild/android-arm": "0.17.19", 573 | "@esbuild/android-arm64": "0.17.19", 574 | "@esbuild/android-x64": "0.17.19", 575 | "@esbuild/darwin-arm64": "0.17.19", 576 | "@esbuild/darwin-x64": "0.17.19", 577 | "@esbuild/freebsd-arm64": "0.17.19", 578 | "@esbuild/freebsd-x64": "0.17.19", 579 | "@esbuild/linux-arm": "0.17.19", 580 | "@esbuild/linux-arm64": "0.17.19", 581 | "@esbuild/linux-ia32": "0.17.19", 582 | "@esbuild/linux-loong64": "0.17.19", 583 | "@esbuild/linux-mips64el": "0.17.19", 584 | "@esbuild/linux-ppc64": "0.17.19", 585 | "@esbuild/linux-riscv64": "0.17.19", 586 | "@esbuild/linux-s390x": "0.17.19", 587 | "@esbuild/linux-x64": "0.17.19", 588 | "@esbuild/netbsd-x64": "0.17.19", 589 | "@esbuild/openbsd-x64": "0.17.19", 590 | "@esbuild/sunos-x64": "0.17.19", 591 | "@esbuild/win32-arm64": "0.17.19", 592 | "@esbuild/win32-ia32": "0.17.19", 593 | "@esbuild/win32-x64": "0.17.19" 594 | } 595 | }, 596 | "node_modules/escape-html": { 597 | "version": "1.0.3", 598 | "license": "MIT" 599 | }, 600 | "node_modules/estree-walker": { 601 | "version": "2.0.2", 602 | "license": "MIT" 603 | }, 604 | "node_modules/fill-range": { 605 | "version": "7.0.1", 606 | "dev": true, 607 | "license": "MIT", 608 | "dependencies": { 609 | "to-regex-range": "^5.0.1" 610 | }, 611 | "engines": { 612 | "node": ">=8" 613 | } 614 | }, 615 | "node_modules/glob-parent": { 616 | "version": "5.1.2", 617 | "dev": true, 618 | "license": "ISC", 619 | "dependencies": { 620 | "is-glob": "^4.0.1" 621 | }, 622 | "engines": { 623 | "node": ">= 6" 624 | } 625 | }, 626 | "node_modules/immutable": { 627 | "version": "4.2.2", 628 | "dev": true, 629 | "license": "MIT" 630 | }, 631 | "node_modules/is-binary-path": { 632 | "version": "2.1.0", 633 | "dev": true, 634 | "license": "MIT", 635 | "dependencies": { 636 | "binary-extensions": "^2.0.0" 637 | }, 638 | "engines": { 639 | "node": ">=8" 640 | } 641 | }, 642 | "node_modules/is-extglob": { 643 | "version": "2.1.1", 644 | "dev": true, 645 | "license": "MIT", 646 | "engines": { 647 | "node": ">=0.10.0" 648 | } 649 | }, 650 | "node_modules/is-glob": { 651 | "version": "4.0.3", 652 | "dev": true, 653 | "license": "MIT", 654 | "dependencies": { 655 | "is-extglob": "^2.1.1" 656 | }, 657 | "engines": { 658 | "node": ">=0.10.0" 659 | } 660 | }, 661 | "node_modules/is-number": { 662 | "version": "7.0.0", 663 | "dev": true, 664 | "license": "MIT", 665 | "engines": { 666 | "node": ">=0.12.0" 667 | } 668 | }, 669 | "node_modules/lodash": { 670 | "version": "4.17.21", 671 | "license": "MIT" 672 | }, 673 | "node_modules/lodash-es": { 674 | "version": "4.17.21", 675 | "license": "MIT" 676 | }, 677 | "node_modules/lodash-unified": { 678 | "version": "1.0.3", 679 | "license": "MIT", 680 | "peerDependencies": { 681 | "@types/lodash-es": "*", 682 | "lodash": "*", 683 | "lodash-es": "*" 684 | } 685 | }, 686 | "node_modules/magic-string": { 687 | "version": "0.25.9", 688 | "license": "MIT", 689 | "dependencies": { 690 | "sourcemap-codec": "^1.4.8" 691 | } 692 | }, 693 | "node_modules/memoize-one": { 694 | "version": "6.0.0", 695 | "license": "MIT" 696 | }, 697 | "node_modules/nanoid": { 698 | "version": "3.3.4", 699 | "license": "MIT", 700 | "bin": { 701 | "nanoid": "bin/nanoid.cjs" 702 | }, 703 | "engines": { 704 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 705 | } 706 | }, 707 | "node_modules/normalize-path": { 708 | "version": "3.0.0", 709 | "dev": true, 710 | "license": "MIT", 711 | "engines": { 712 | "node": ">=0.10.0" 713 | } 714 | }, 715 | "node_modules/normalize-wheel-es": { 716 | "version": "1.2.0", 717 | "license": "BSD-3-Clause" 718 | }, 719 | "node_modules/picocolors": { 720 | "version": "1.0.0", 721 | "license": "ISC" 722 | }, 723 | "node_modules/picomatch": { 724 | "version": "2.3.1", 725 | "dev": true, 726 | "license": "MIT", 727 | "engines": { 728 | "node": ">=8.6" 729 | }, 730 | "funding": { 731 | "url": "https://github.com/sponsors/jonschlinkert" 732 | } 733 | }, 734 | "node_modules/postcss": { 735 | "version": "8.4.21", 736 | "funding": [ 737 | { 738 | "type": "opencollective", 739 | "url": "https://opencollective.com/postcss/" 740 | }, 741 | { 742 | "type": "tidelift", 743 | "url": "https://tidelift.com/funding/github/npm/postcss" 744 | } 745 | ], 746 | "license": "MIT", 747 | "dependencies": { 748 | "nanoid": "^3.3.4", 749 | "picocolors": "^1.0.0", 750 | "source-map-js": "^1.0.2" 751 | }, 752 | "engines": { 753 | "node": "^10 || ^12 || >=14" 754 | } 755 | }, 756 | "node_modules/readdirp": { 757 | "version": "3.6.0", 758 | "dev": true, 759 | "license": "MIT", 760 | "dependencies": { 761 | "picomatch": "^2.2.1" 762 | }, 763 | "engines": { 764 | "node": ">=8.10.0" 765 | } 766 | }, 767 | "node_modules/rollup": { 768 | "version": "3.23.0", 769 | "dev": true, 770 | "license": "MIT", 771 | "bin": { 772 | "rollup": "dist/bin/rollup" 773 | }, 774 | "engines": { 775 | "node": ">=14.18.0", 776 | "npm": ">=8.0.0" 777 | }, 778 | "optionalDependencies": { 779 | "fsevents": "~2.3.2" 780 | } 781 | }, 782 | "node_modules/sass": { 783 | "version": "1.57.1", 784 | "dev": true, 785 | "license": "MIT", 786 | "dependencies": { 787 | "chokidar": ">=3.0.0 <4.0.0", 788 | "immutable": "^4.0.0", 789 | "source-map-js": ">=0.6.2 <2.0.0" 790 | }, 791 | "bin": { 792 | "sass": "sass.js" 793 | }, 794 | "engines": { 795 | "node": ">=12.0.0" 796 | } 797 | }, 798 | "node_modules/source-map": { 799 | "version": "0.6.1", 800 | "license": "BSD-3-Clause", 801 | "engines": { 802 | "node": ">=0.10.0" 803 | } 804 | }, 805 | "node_modules/source-map-js": { 806 | "version": "1.0.2", 807 | "license": "BSD-3-Clause", 808 | "engines": { 809 | "node": ">=0.10.0" 810 | } 811 | }, 812 | "node_modules/sourcemap-codec": { 813 | "version": "1.4.8", 814 | "license": "MIT" 815 | }, 816 | "node_modules/to-regex-range": { 817 | "version": "5.0.1", 818 | "dev": true, 819 | "license": "MIT", 820 | "dependencies": { 821 | "is-number": "^7.0.0" 822 | }, 823 | "engines": { 824 | "node": ">=8.0" 825 | } 826 | }, 827 | "node_modules/vite": { 828 | "version": "4.3.9", 829 | "dev": true, 830 | "license": "MIT", 831 | "dependencies": { 832 | "esbuild": "^0.17.5", 833 | "postcss": "^8.4.23", 834 | "rollup": "^3.21.0" 835 | }, 836 | "bin": { 837 | "vite": "bin/vite.js" 838 | }, 839 | "engines": { 840 | "node": "^14.18.0 || >=16.0.0" 841 | }, 842 | "optionalDependencies": { 843 | "fsevents": "~2.3.2" 844 | }, 845 | "peerDependencies": { 846 | "@types/node": ">= 14", 847 | "less": "*", 848 | "sass": "*", 849 | "stylus": "*", 850 | "sugarss": "*", 851 | "terser": "^5.4.0" 852 | }, 853 | "peerDependenciesMeta": { 854 | "@types/node": { 855 | "optional": true 856 | }, 857 | "less": { 858 | "optional": true 859 | }, 860 | "sass": { 861 | "optional": true 862 | }, 863 | "stylus": { 864 | "optional": true 865 | }, 866 | "sugarss": { 867 | "optional": true 868 | }, 869 | "terser": { 870 | "optional": true 871 | } 872 | } 873 | }, 874 | "node_modules/vite/node_modules/nanoid": { 875 | "version": "3.3.6", 876 | "dev": true, 877 | "funding": [ 878 | { 879 | "type": "github", 880 | "url": "https://github.com/sponsors/ai" 881 | } 882 | ], 883 | "license": "MIT", 884 | "bin": { 885 | "nanoid": "bin/nanoid.cjs" 886 | }, 887 | "engines": { 888 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 889 | } 890 | }, 891 | "node_modules/vite/node_modules/postcss": { 892 | "version": "8.4.24", 893 | "dev": true, 894 | "funding": [ 895 | { 896 | "type": "opencollective", 897 | "url": "https://opencollective.com/postcss/" 898 | }, 899 | { 900 | "type": "tidelift", 901 | "url": "https://tidelift.com/funding/github/npm/postcss" 902 | }, 903 | { 904 | "type": "github", 905 | "url": "https://github.com/sponsors/ai" 906 | } 907 | ], 908 | "license": "MIT", 909 | "dependencies": { 910 | "nanoid": "^3.3.6", 911 | "picocolors": "^1.0.0", 912 | "source-map-js": "^1.0.2" 913 | }, 914 | "engines": { 915 | "node": "^10 || ^12 || >=14" 916 | } 917 | }, 918 | "node_modules/vue": { 919 | "version": "3.2.45", 920 | "license": "MIT", 921 | "dependencies": { 922 | "@vue/compiler-dom": "3.2.45", 923 | "@vue/compiler-sfc": "3.2.45", 924 | "@vue/runtime-dom": "3.2.45", 925 | "@vue/server-renderer": "3.2.45", 926 | "@vue/shared": "3.2.45" 927 | } 928 | }, 929 | "node_modules/vue-demi": { 930 | "version": "0.13.11", 931 | "hasInstallScript": true, 932 | "license": "MIT", 933 | "bin": { 934 | "vue-demi-fix": "bin/vue-demi-fix.js", 935 | "vue-demi-switch": "bin/vue-demi-switch.js" 936 | }, 937 | "engines": { 938 | "node": ">=12" 939 | }, 940 | "funding": { 941 | "url": "https://github.com/sponsors/antfu" 942 | }, 943 | "peerDependencies": { 944 | "@vue/composition-api": "^1.0.0-rc.1", 945 | "vue": "^3.0.0-0 || ^2.6.0" 946 | }, 947 | "peerDependenciesMeta": { 948 | "@vue/composition-api": { 949 | "optional": true 950 | } 951 | } 952 | }, 953 | "node_modules/vue-router": { 954 | "version": "4.1.6", 955 | "license": "MIT", 956 | "dependencies": { 957 | "@vue/devtools-api": "^6.4.5" 958 | }, 959 | "funding": { 960 | "url": "https://github.com/sponsors/posva" 961 | }, 962 | "peerDependencies": { 963 | "vue": "^3.2.0" 964 | } 965 | } 966 | } 967 | } 968 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tauri-vue-app", 3 | "private": true, 4 | "version": "1.0.1", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "tauri build": "tauri build", 10 | "preview": "vite preview", 11 | "tauri": "tauri", 12 | "tauri dev": "tauri dev" 13 | }, 14 | "dependencies": { 15 | "@tauri-apps/api": "^2.4.1", 16 | "@tauri-apps/plugin-dialog": "^2.2.1", 17 | "@tauri-apps/plugin-shell": "^2.2.0", 18 | "element-plus": "^2.2.28", 19 | "vue": "^3.2.45", 20 | "vue-router": "^4.1.6" 21 | }, 22 | "devDependencies": { 23 | "@tauri-apps/cli": "^2.4.1", 24 | "@vitejs/plugin-vue": "^4.0.0", 25 | "sass": "^1.57.1", 26 | "vite": "^4.2.1" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /public/tauri.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src-tauri/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | /gen/schemas 5 | -------------------------------------------------------------------------------- /src-tauri/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tauri-vue-app" 3 | version = "1.0.1" 4 | description = "Tauri Vue App" 5 | authors = ["you"] 6 | license = "" 7 | repository = "" 8 | edition = "2021" 9 | rust-version = "1.77.2" 10 | 11 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 12 | 13 | [lib] 14 | name = "app_lib" 15 | crate-type = ["staticlib", "cdylib", "rlib"] 16 | 17 | [build-dependencies] 18 | tauri-build = { version = "2.0.2", features = [] } 19 | 20 | [dependencies] 21 | serde_json = "1.0" 22 | serde = { version = "1.0", features = ["derive"] } 23 | log = "0.4" 24 | tauri = { version = "2.4.1", features = ["tray-icon", "image-png", "devtools" ] } 25 | tauri-plugin-log = "2.0.0-rc" 26 | tauri-plugin-dialog = "2" 27 | 28 | [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] 29 | tauri-plugin-single-instance = "2" 30 | -------------------------------------------------------------------------------- /src-tauri/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tauri_build::build() 3 | } 4 | -------------------------------------------------------------------------------- /src-tauri/capabilities/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../gen/schemas/desktop-schema.json", 3 | "identifier": "default", 4 | "description": "enables the default permissions", 5 | "windows": [ 6 | "main" 7 | ], 8 | "permissions": [ 9 | "core:default", 10 | "dialog:default", 11 | "core:window:allow-toggle-maximize", 12 | "core:window:allow-minimize", 13 | "core:window:allow-close", 14 | "core:window:allow-start-dragging", 15 | "core:window:allow-unminimize", 16 | "core:window:allow-show", 17 | "core:window:allow-set-focus", 18 | "core:app:allow-default-window-icon" 19 | ] 20 | } -------------------------------------------------------------------------------- /src-tauri/icons/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/128x128.png -------------------------------------------------------------------------------- /src-tauri/icons/128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/128x128@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/32x32.png -------------------------------------------------------------------------------- /src-tauri/icons/Square107x107Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square107x107Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square142x142Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square142x142Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square150x150Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square284x284Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square284x284Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square30x30Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square30x30Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square310x310Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square310x310Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square44x44Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square71x71Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square71x71Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square89x89Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/Square89x89Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/StoreLogo.png -------------------------------------------------------------------------------- /src-tauri/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/icon.icns -------------------------------------------------------------------------------- /src-tauri/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/icon.ico -------------------------------------------------------------------------------- /src-tauri/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src-tauri/icons/icon.png -------------------------------------------------------------------------------- /src-tauri/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg_attr(mobile, tauri::mobile_entry_point)] 2 | 3 | use tauri::{AppHandle, Manager}; 4 | 5 | pub fn run() { 6 | tauri::Builder::default() 7 | .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| { 8 | let _ = show_window(app); 9 | })) 10 | .plugin(tauri_plugin_dialog::init()) 11 | .invoke_handler(tauri::generate_handler![quit]) 12 | .setup(|app| { 13 | if cfg!(debug_assertions) { 14 | app.handle().plugin( 15 | tauri_plugin_log::Builder::default() 16 | .level(log::LevelFilter::Info) 17 | .build(), 18 | )?; 19 | } 20 | Ok(()) 21 | }) 22 | .run(tauri::generate_context!()) 23 | .expect("error while running tauri application"); 24 | } 25 | fn show_window(app: &AppHandle) { 26 | let windows = app.webview_windows(); 27 | 28 | windows 29 | .values() 30 | .next() 31 | .expect("Sorry, no window found") 32 | .set_focus() 33 | .expect("Can't Bring Window to Focus"); 34 | } 35 | #[tauri::command] 36 | fn quit() { 37 | std::process::exit(0); 38 | } -------------------------------------------------------------------------------- /src-tauri/src/main.rs: -------------------------------------------------------------------------------- 1 | // Prevents additional console window on Windows in release, DO NOT REMOVE!! 2 | #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] 3 | 4 | fn main() { 5 | app_lib::run(); 6 | } 7 | -------------------------------------------------------------------------------- /src-tauri/tauri.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", 3 | "productName": "Tauri Vue App", 4 | "version": "1.0.1", 5 | "identifier": "com.young.dev", 6 | "build": { 7 | "frontendDist": "../dist", 8 | "devUrl": "http://localhost:1420", 9 | "beforeDevCommand": "npm run dev", 10 | "beforeBuildCommand": "npm run build" 11 | }, 12 | "app": { 13 | "windows": [ 14 | { 15 | "label": "main", 16 | "fullscreen": false, 17 | "height": 800, 18 | "width":1000, 19 | "center":true, 20 | "resizable": true, 21 | "title": "Tauri Vue App", 22 | "decorations":false 23 | } 24 | ], 25 | "security": { 26 | "csp": null 27 | }, 28 | "withGlobalTauri": true 29 | }, 30 | "bundle": { 31 | "active": true, 32 | "targets": "all", 33 | "category": "DeveloperTool", 34 | "copyright": "", 35 | "externalBin": [], 36 | "icon": [ 37 | "icons/32x32.png", 38 | "icons/128x128.png", 39 | "icons/128x128@2x.png", 40 | "icons/icon.icns", 41 | "icons/icon.ico" 42 | ], 43 | "longDescription": "", 44 | "macOS": { 45 | "entitlements": null, 46 | "exceptionDomain": "", 47 | "frameworks": [], 48 | "providerShortName": null, 49 | "signingIdentity": null 50 | }, 51 | "resources": [], 52 | "shortDescription": "", 53 | "windows": { 54 | "wix": { 55 | "language": "zh-CN" 56 | }, 57 | "nsis": { 58 | "languages": ["SimpChinese"], 59 | "installerIcon":"icons/icon.ico" 60 | }, 61 | "certificateThumbprint": null, 62 | "digestAlgorithm": "sha256", 63 | "timestampUrl": "" 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 15 | 32 | -------------------------------------------------------------------------------- /src/assets/app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src/assets/app.png -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; /* Project id 3172745 */ 3 | src: url('iconfont.woff2?t=1652951873556') format('woff2'), 4 | url('iconfont.woff?t=1652951873556') format('woff'), 5 | url('iconfont.ttf?t=1652951873556') format('truetype'); 6 | } 7 | 8 | .iconfont { 9 | font-family: "iconfont" !important; 10 | font-size: 16px; 11 | font-style: normal; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | .icon-device:before { 17 | content: "\e603"; 18 | } 19 | 20 | .icon-questionfill:before { 21 | content: "\e694"; 22 | } 23 | 24 | .icon-delete:before { 25 | content: "\e6b4"; 26 | } 27 | 28 | .icon-window-minimize2:before { 29 | content: "\e609"; 30 | } 31 | 32 | .icon-window-minimize:before { 33 | content: "\e93e"; 34 | } 35 | 36 | .icon-window-close:before { 37 | content: "\e617"; 38 | } 39 | 40 | .icon-window-maximize:before { 41 | content: "\e669"; 42 | } 43 | 44 | .icon-window-restore:before { 45 | content: "\e66a"; 46 | } 47 | 48 | .icon-menu:before { 49 | content: "\e624"; 50 | } 51 | 52 | .icon-server-solid1:before { 53 | content: "\e611"; 54 | } 55 | 56 | .icon-config-icon:before { 57 | content: "\e68b"; 58 | } 59 | 60 | .icon-web:before { 61 | content: "\e605"; 62 | } 63 | 64 | .icon-cloud:before { 65 | content: "\eb66"; 66 | } 67 | 68 | .icon-tool:before { 69 | content: "\e70c"; 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.js: -------------------------------------------------------------------------------- 1 | !function(c){var t,e,o,i,n,l='',s=(s=document.getElementsByTagName("script"))[s.length-1].getAttribute("data-injectcss"),d=function(c,t){t.parentNode.insertBefore(c,t)};if(s&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function h(){n||(n=!0,o())}function m(){try{i.documentElement.doScroll("left")}catch(c){return void setTimeout(m,50)}h()}t=function(){var c,t=document.createElement("div");t.innerHTML=l,l=null,(t=t.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",t=t,(c=document.body).firstChild?d(t,c.firstChild):c.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(e=function(){document.removeEventListener("DOMContentLoaded",e,!1),t()},document.addEventListener("DOMContentLoaded",e,!1)):document.attachEvent&&(o=t,i=c.document,n=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,h())})}(window); -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3172745", 3 | "name": "MPS SERVICE", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon-", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "1174871", 10 | "name": "device", 11 | "font_class": "device", 12 | "unicode": "e603", 13 | "unicode_decimal": 58883 14 | }, 15 | { 16 | "icon_id": "31334", 17 | "name": "question_fill", 18 | "font_class": "questionfill", 19 | "unicode": "e694", 20 | "unicode_decimal": 59028 21 | }, 22 | { 23 | "icon_id": "32477", 24 | "name": "delete", 25 | "font_class": "delete", 26 | "unicode": "e6b4", 27 | "unicode_decimal": 59060 28 | }, 29 | { 30 | "icon_id": "18309149", 31 | "name": "window-minimize", 32 | "font_class": "window-minimize2", 33 | "unicode": "e609", 34 | "unicode_decimal": 58889 35 | }, 36 | { 37 | "icon_id": "1445627", 38 | "name": "window-minimize", 39 | "font_class": "window-minimize", 40 | "unicode": "e93e", 41 | "unicode_decimal": 59710 42 | }, 43 | { 44 | "icon_id": "6231096", 45 | "name": "window-close", 46 | "font_class": "window-close", 47 | "unicode": "e617", 48 | "unicode_decimal": 58903 49 | }, 50 | { 51 | "icon_id": "18365388", 52 | "name": "window-maximize", 53 | "font_class": "window-maximize", 54 | "unicode": "e669", 55 | "unicode_decimal": 58985 56 | }, 57 | { 58 | "icon_id": "18365412", 59 | "name": "window-restore", 60 | "font_class": "window-restore", 61 | "unicode": "e66a", 62 | "unicode_decimal": 58986 63 | }, 64 | { 65 | "icon_id": "10793062", 66 | "name": "menu", 67 | "font_class": "menu", 68 | "unicode": "e624", 69 | "unicode_decimal": 58916 70 | }, 71 | { 72 | "icon_id": "14660292", 73 | "name": "server-solid", 74 | "font_class": "server-solid1", 75 | "unicode": "e611", 76 | "unicode_decimal": 58897 77 | }, 78 | { 79 | "icon_id": "9631242", 80 | "name": "config-icon", 81 | "font_class": "config-icon", 82 | "unicode": "e68b", 83 | "unicode_decimal": 59019 84 | }, 85 | { 86 | "icon_id": "6231012", 87 | "name": "web", 88 | "font_class": "web", 89 | "unicode": "e605", 90 | "unicode_decimal": 58885 91 | }, 92 | { 93 | "icon_id": "6988037", 94 | "name": "cloud", 95 | "font_class": "cloud", 96 | "unicode": "eb66", 97 | "unicode_decimal": 60262 98 | }, 99 | { 100 | "icon_id": "7239575", 101 | "name": "tool", 102 | "font_class": "tool", 103 | "unicode": "e70c", 104 | "unicode_decimal": 59148 105 | } 106 | ] 107 | } 108 | -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src/assets/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src/assets/iconfont/iconfont.woff -------------------------------------------------------------------------------- /src/assets/iconfont/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangdaichun/tauri-vue-app/760a71550c84db82d5fa11de3d477928d63aced3/src/assets/iconfont/iconfont.woff2 -------------------------------------------------------------------------------- /src/assets/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/layout/header/index.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /src/components/layout/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 16 | 30 | -------------------------------------------------------------------------------- /src/components/layout/main/index.vue: -------------------------------------------------------------------------------- 1 | 19 | 22 | -------------------------------------------------------------------------------- /src/components/layout/side/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 40 | -------------------------------------------------------------------------------- /src/components/system/index.vue: -------------------------------------------------------------------------------- 1 | 29 | 91 | 115 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import router from './router/index' 4 | import plugins from './plugins/index' 5 | import tray_init from "./tray.js" 6 | 7 | tray_init() 8 | createApp(App).use(router).use(plugins).mount('#app') 9 | -------------------------------------------------------------------------------- /src/plugins/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | install: (app) => { 3 | const files =import.meta.glob("./modules/*.js",{eager:true}) 4 | 5 | for (const key in files) { 6 | if (Object.prototype.hasOwnProperty.call(files, key)) { 7 | app.use(files[key].default) 8 | } 9 | } 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/plugins/modules/element.js: -------------------------------------------------------------------------------- 1 | import ElementPlus from 'element-plus' 2 | import 'element-plus/dist/index.css' 3 | export default { 4 | install: (app) => { 5 | app.use(ElementPlus) 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /src/plugins/modules/iconfont.js: -------------------------------------------------------------------------------- 1 | import '@/assets/iconfont/iconfont.css' 2 | export default { 3 | install: () => {}, 4 | } 5 | -------------------------------------------------------------------------------- /src/plugins/modules/router.js: -------------------------------------------------------------------------------- 1 | import router from '@/router' 2 | 3 | export default { 4 | install: () => { 5 | router.beforeEach(async (to, from, next) => { 6 | if (to.path == '/') { 7 | next({path:'/home'}) 8 | } else { 9 | next() 10 | } 11 | }) 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHashHistory } from 'vue-router' 2 | 3 | const routes = [ 4 | { 5 | path: '/', 6 | name: 'Layout', 7 | component: () => import('@/components/layout/index.vue'), 8 | children: [ 9 | { 10 | path: '/home', 11 | name: 'Home', 12 | meta: { 13 | keepAlive: true, 14 | }, 15 | component: () => import('@/views/home/index.vue'), 16 | }, 17 | { 18 | path: '/search', 19 | name: 'Search', 20 | meta: { 21 | keepAlive: true, 22 | }, 23 | component: () => import('@/views/search/index.vue'), 24 | }, 25 | ], 26 | } 27 | ] 28 | 29 | const router = createRouter({ 30 | history: createWebHashHistory(), 31 | routes, 32 | }) 33 | 34 | export default router 35 | -------------------------------------------------------------------------------- /src/tray.js: -------------------------------------------------------------------------------- 1 | import { TrayIcon } from '@tauri-apps/api/tray'; 2 | import { invoke } from '@tauri-apps/api/core'; 3 | import { confirm } from '@tauri-apps/plugin-dialog'; 4 | import { defaultWindowIcon } from '@tauri-apps/api/app'; 5 | import { getCurrentWindow } from '@tauri-apps/api/window'; 6 | 7 | import { Menu } from '@tauri-apps/api/menu'; 8 | 9 | export default async function init_tray() { 10 | 11 | const onTrayMenuClick = async (itemId) => { 12 | switch(itemId){ 13 | case 'quit':{ 14 | // 退出逻辑 15 | const confirmation = await confirm( 16 | '确定要退出程序吗?', 17 | { title: '退出', kind: 'warning' } 18 | ); 19 | if(confirmation) { 20 | //请求rust后端方法关闭程序 21 | invoke('quit') 22 | } 23 | } break 24 | case 'test':{ 25 | console.log("点击了测试菜单") 26 | } break 27 | } 28 | } 29 | 30 | const menu = await Menu.new({ 31 | items: [ 32 | { 33 | id: 'quit', 34 | text: '退出', 35 | action: onTrayMenuClick, 36 | }, 37 | { 38 | id: 'test', 39 | text: '测试', 40 | action: onTrayMenuClick, 41 | } 42 | ], 43 | }); 44 | 45 | const options = { 46 | icon: await defaultWindowIcon(), 47 | menu, 48 | menuOnLeftClick: false, 49 | tooltip:'Tauri Vue App', 50 | action: (event) => { 51 | switch(event.type) { 52 | case 'DoubleClick' : { 53 | const currentWindow = getCurrentWindow() 54 | currentWindow.unminimize() 55 | currentWindow.show() 56 | currentWindow.setFocus() 57 | } break 58 | } 59 | } 60 | }; 61 | 62 | const tray = await TrayIcon.new(options) 63 | } -------------------------------------------------------------------------------- /src/views/home/index.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/views/search/index.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite"; 2 | import vue from "@vitejs/plugin-vue"; 3 | import path from 'path' 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [vue()], 8 | 9 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` 10 | // prevent vite from obscuring rust errors 11 | clearScreen: false, 12 | // tauri expects a fixed port, fail if that port is not available 13 | server: { 14 | port: 1420, 15 | strictPort: true, 16 | }, 17 | base:'./', 18 | resolve:{ 19 | alias:{ 20 | '@':path.resolve(__dirname,'./src') 21 | } 22 | }, 23 | // to make use of `TAURI_DEBUG` and other env variables 24 | // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand 25 | envPrefix: ["VITE_", "TAURI_"], 26 | build: { 27 | // Tauri supports es2021 28 | target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13", 29 | // don't minify for debug builds 30 | minify: !process.env.TAURI_DEBUG ? "esbuild" : false, 31 | // produce sourcemaps for debug builds 32 | sourcemap: !!process.env.TAURI_DEBUG, 33 | }, 34 | }); 35 | --------------------------------------------------------------------------------