How to drag elements in Ionic 4/5

这一生的挚爱 提交于 2020-07-09 11:49:05

问题


I would like to create draggable (free) buttons in Ionic. In ionic 3 I used a directive to do this (link https://www.joshmorony.com/building-an-absolute-drag-directive-in-ionic-2/) but this directive don't works in ionic 5 and it does not give any errors. What do you think is the best library (supported from some tutorial) for ionic 5 to do this? Thanks in advance.


回答1:


This does not have to be Ionic specific. If you are using angular you can just use an NPM component such as https://www.npmjs.com/package/angular-draggable-droppable

There is also support for this in Angular Material library

https://material.angular.io/cdk/drag-drop/overview



来源:https://stackoverflow.com/questions/62580511/how-to-drag-elements-in-ionic-4-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!