Sworld

Sworld

The only way to do great work is to love what you do.

解決Tauri2無法拖曳

近期將我的遊戲存檔管理器遷移到 Tauri2 出現點問題,想起來以前 V1 的時候也遇到過這個問題,故記錄下來。

具體問題就是在前端一個可拖拽組件沒有辦法被拖動,處理方式很簡單,直接修改src-tauri/tauri.conf.json文件,將dragDropEnabled設為false,作為參考,請看:

{
  "$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": "遊戲存檔管理器",
        "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"
    ]
  }
}
載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。