问题
应用里使用了vue-draggable-plus作为拖拽库,但是却没有效果,在拖拽元素时拖拽图标还会变成ban图标,类似这种🚫。
解决
这时我们需要将tauri.conf.json文件中windows属性dragDropEnabled设置为false
{
...
"app": {
"windows": [
{
...
"dragDropEnabled": false
}
],
},
...
}
官方文档也有明确指出,如果你使用HTML5拖放功能需要禁用它。
官方文档
Whether the drag and drop is enabled or not on the webview. By default it is enabled.
Disabling it is required to use HTML5 drag and drop on the frontend on Windows.
备注:在Tauri 1.x 版本中
dragDropEnabled原名为fileDropEnabled
评论区