解决Tauri2无法拖拽

近期将我的游戏存档管理器迁移到Tauri2出现点问题,想起来以前V1的时候也遇到过这个问题,故记录下来。

具体问题就是在前端一个可拖拽组件没有办法被拖动,处理方式很简单,直接修改src-tauri/tauri.conf.json文件,将dragDropEnabled设为false,作为参考,请看:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "game-save-manager",
"identifier": "com.game-save-manager",
"build": {
"frontendDist": "../dist",
"devUrl": "http://localhost:3000",
"beforeDevCommand": "pnpm web:dev",
"beforeBuildCommand": "pnpm web:generate"
},
"app": {
"windows": [
{
"title": "Game Save Manager",
"width": 1280,
"height": 720,
"resizable": true,
"fullscreen": false,
"dragDropEnabled": false
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
]
}
}