克隆JavaScript对象的最有效方法是什么?我已经看到obj = eval(uneval(o));被使用,但这是非标准的,只有Firefox支持.
我做过类似的事情,obj = JSON.parse(JSON.stringify(o));但质疑效率.
我也看到了具有各种缺陷的递归复制功能.
我很惊讶没有规范的解决方案.
我想仅CTRL + Drag & Drop使用PURE JavaScript在 FullCalendar v5 中实现。
我对主题进行了研究,发现这是在 FC github 上作为新功能 UI 请求进行讨论的。很少有建议如何做到这一点,即使是可行的建议。
You can use eventDrop to create this feature. jsEvent has a ctrlKey
on which you can test. Copy the event, received as a parameter, in a new variable.
revertFunc to make go back, and then apply renderEvent with the new variable created.
Run Code Online (Sandbox Code Playgroud)